Fault detecting apparatus and method

ABSTRACT

A control system for detecting a potentially faulty detector which may be causing faulty actuation of an actuator of a controlled system has an input-signal memory for storing the state of an input signal from the detector, an auxiliary input-signal memory for storing the state of an input signal provided by an auxiliary-signal generator, an arithmetic-logic unit for generating an output signal to be applied to the actuator in accordance with predetermined logic in conformity with the states of the input signals stored in the input-signal memory and auxiliary input-signal memory, and an output-signal memory for storing the state of an output signal generated by the arithmetic-logic unit. An identification code of an abnormal output signal corresponding to the abnormal actuator which is designated, and an input signal that has influenced a logical operation, performed by the arithmetic-logic unit, and which gave rise to the designated abnormal output signal, is extracted. If the extracted input signal is the signal that has been stored in the input-signal memory, an identification code of this input signal is stored in a storage device.

TECHNICAL FIELD

This invention relates to a fault detecting apparatus and method. Moreparticularly, the invention relates to an apparatus and method fordetecting a location at which a failure is possible in one or both of adetector and actuator in a controlled system by investigating theinternal states of a programmable logic controller (hereinafter referredto simply as a "PLC").

BACKGROUND ART

PLCs are used widely in the sequence control of a large variety ofcontrolled systems.

The controlled system is provided with many detectors (sensors andswitches such as proximity switches, limit switches and photoelectricdetectors) for extracting the operating state of the system, as well asa plurality of actuators (air cylinders, hydraulic cylinders, motors,etc.) for driving each component of the controlled system.

The signals from the detectors are applied to a PLC as input signals.The PLC, in which a user program for controlling the controlled systemhas been installed in advance, generates outputs signals (relay signals)for controlling the actuators in accordance with the user program inresponse to the input signals.

In general, the function of the PLC, namely the user program that hasbeen installed in the PLC, is expressed by a ladder circuit (diagram). Aladder circuit comprises a plurality of individual ladder circuits.

FIG. 27 shows an example of a ladder circuit represented by a ladderdiagram. This ladder circuit has individual ladder circuits L01, L02 andL03.

The individual ladder circuit L01 is composed of contacts (actual inputcontacts) 001 and 002 representing the status of input signals providedby the detectors of a controlled system, and an output relay 003. Theindividual ladder circuit L02 is composed of actual input contacts 004,005, 006 and 007, a contact (internal auxiliary contact) 003 controlledby the output relay 003, and an output relay 008. The individual laddercircuit L03 is composed of actual input contacts 009, 010, an internalauxiliary contact 008 controlled by the output relay 008, a self-holdingcontact 011 of an output relay 011, and the output relay 011.

The contacts 001, 003, 005, etc., are a contacts (make contacts), andthe contacts 002, 004 and 006, etc., are b contacts (break contacts).

If all of the serially connected contacts are 0N (closed), then theoutput relay connected to these contacts also is ON (closed). The relayoutputs are sent to actuators to actuate them. For example, if thecontacts 001 and 002 in the individual ladder circuit L01 are ON, thenthe output relay 003 also is ON. Further, if the contacts 004, 005, 003and 006 are ON or the contacts 007 and 006 are ON in the individualladder circuit L02, then the output relay 008 also is ON.

In a case where a prescribed operation is not performed in the PLCconstituted by such a ladder circuit owing to a failure in thecontrolled system or a defect in a contact, the operator ascertains theabnormal location by referring to the states of the input/output signalsand the ladder diagram of the PLC or the program list of the ladderprogram.

More specifically, the operator specifies the actuator that is notoperating normally and specifies the output relay that is applying theoutput signal to the specified actuator. Then, while referring to theladder diagram or program list, the operator scans and checks, one byone, the plurality of contacts connected to the specified output relay.

For example, consider a case in which the specified output relay is theoutput relay 011, which is in the OFF state regardless of the fact thatit should be ON.

First, the contacts 010, 008, 009 and 011 connected to the output relay011 are investigated to see if they are ON. If the contact 008 is OFF,then the output relay 008 controlling the contact 008 and the contacts006, 003, 005, 004 and 007 connected to the output relay 008 areinvestigated to see if they are ON. If, by way of example, the contact003 is OFF, then the output relay 003 and the contacts 001 and 002connected to the output relay 003 are investigated. If the contact 001is OFF, then this contact and the detector that applies the input signalto the contact are taken as candidates for cause of the failure.Alternatively, in a case where the contact 007 is an actual inputcontact and is in the OFF state, the contact 007 and the detector thatapplies a signal to this contact also are taken as candidates for causeof the failure.

Thus, the operator specifies the output relay that is not in the normalstate, investigates the contacts, which are connected to this outputrelay, while tracing them in successive fashion, extracts a contact andthe detector that applies the signal to this contact as candidates forcause of the failure and eventually specifies the faulty location.

In such detection of a faulty location by the operator, however, aproblem which arises is that the operator cannot specify an actuator aswell as the output relay of the ladder circuit that applies the signalto this actuator unless the operator has an understanding of the overalloperation of the entire controlled system.

Further, even if the operator does understand the overall operation ofthe controlled system, it is not easy to specify an abnormally operatingactuator and the output relay applying the signal to this actuator ifthe controlled system is large in scale and complex.

Furthermore, even if the output relay of a ladder circuit can bespecified, it is necessary for the operator to ascertain the abnormallocation while referring successively to the states of the input/outputsignals and the ladder diagram or program list of the PLC. For thisreason, the detection of a faulty location is a troublesome task and atime-consuming one as well. Accordingly, repairing the failure andrestarting the controlled system requires a long period of time. Inparticular, the larger the scale of the ladder circuit and the morecomplicated it becomes, the greater the time needed to detect thelocation of the failure.

DISCLOSURE OF THE INVENTION

An object of the present invention is to provide a fault detectingapparatus and method in which a candidate for a detector that haspossibly failed can be detected easily and in a short period of time.

Another object of the present invention is to provide a fault detectingapparatus and method in which an actuator that has possibly failed canbe detected easily and in a short period of time.

Still another object of the present invention is to provide a faultdetecting apparatus and method in which an actuator that does notoperate normally can be detected with ease and in a short period oftime, and in which a candidate for a detector that is the cause of theabnormal operation can be detected with ease and in a short period oftime.

A further object of the present invention is to provide a faultdetecting apparatus and method in which a candidate for a contact due toan error in a user program or erroneous designation of an output relaycan be detected with ease and in a short period of time.

An apparatus for detecting a fault in a detector according to a firstaspect of the present invention detects the fault through a controlapparatus, which controls a controlled system including one or two ormore detectors and one or two or more actuators, having input-signalmemory means for storing the state of an input signal from the detector,auxiliary input-signal memory means for storing the state of an inputsignal provided by auxiliary-signal generating means, arithmetic-logicmeans for generating an output signal to be applied to the actuator inaccordance with predetermined logic in conformity with the states of theinput signals stored in the input-signal memory means and auxiliaryinput-signal memory means, and output-signal memory means for storingthe state of the output signal generated by the arithmetic-logic means,wherein when there is an actuator not operating normally in thecontrolled system, a detector that is possibly faulty in the controlledsystem is detected through the control apparatus, the apparatus fordetecting the fault comprising a designation input unit for designatingan identification code of an abnormal output signal corresponding to theactuator not operating normally, input-signal extracting means forextracting an input signal that has influenced a logical operation,performed by the arithmetic-logic means, which gave rise to the abnormaloutput signal designated by the designation input unit, determiningmeans for determining whether the input signal extracted by theinput-signal extracting means is the signal that has been stored in theinput-signal memory means, and a storage device which, if result of thedetermination by the determining means is that the extracted inputsignal is the signal that has been stored in the input-signal memorymeans, stores the identification code of this input signal.

A method of detecting a fault in a detector according to the firstaspect of the present invention detects the fault through a controlapparatus, which controls a controlled system including one or two ormore detectors and one or two or more actuators, having input-signalmemory means for storing the state of an input signal from the detector,auxiliary input-signal memory means for storing the state of an inputsignal provided by auxiliary-signal generating means, arithmetic-logicmeans for generating an output signal to be applied to the actuator inaccordance with predetermined logic in conformity with the states of theinput signals stored in the input-signal memory means and auxiliaryinput-signal memory means, and output-signal memory means for storingthe state of the output signal generated by the arithmetic-logic means,wherein when there is an actuator not operating normally in thecontrolled system, a detector that is possibly faulty in the controlledsystem is detected through the control apparatus, the method ofdetecting the fault comprising designating an identification code of anabnormal output signal corresponding to the actuator not operatingnormally, extracting an input signal that has influenced a logicaloperation, performed by the arithmetic-logic means, which gave rise tothe designated abnormal output signal, determining whether the extractedinput signal is the signal that has been stored in the input-signalmemory means, and, if result of the determination is that the extractedinput signal is the signal that has been stored in the input-signalmemory means, storing the identification code of this input signal in astorage device.

In accordance with the first aspect of the present invention, operationis such that when the identification code of an abnormal output signalcorresponding to an actuator that does not operate normally isdesignated/the input signal that has influenced the logical operationwhich produces the designated abnormal output signal is extracted. Theidentification code of an input signal that has been stored in theinput-signal memory means is stored in the storage device.

The input signal that has been stored in the storage device is a signalfrom a detector in the controlled system. Therefore, in a case where theactuator does not operate normally, a candidate for a detector causingthe abnormality can be detected and specified easily and in a shortperiod of time.

Preferably, the identification code of the input signal stored in thestorage device is displayed on a display unit. As a result, the user oroperator can visually confirm which input signal has been extracted.

In a preferred embodiment of the first aspect of the present invention,operation is such that in a case where the result of determination isthat the extracted input signal is the signal that has been stored inthe auxiliary input-signal memory means and that it is controlled by thestate of the output signal of the control apparatus, processing forextracting the input signal that has influenced the logical operation,performed by the arithmetic-logic means, which gave rise to the abnormaloutput signal that controls the state of the extracted input signal isrepeated.

As a result, in a case where the extracted input signal is onecontrolled by the state of the output signal of the control apparatus,an input signal that has influenced the logical operation giving rise tothe output signal can also be investigated, and it is also possible todetect a failure in the detector corresponding to the input signal.

Further, in another embodiment of the first aspect of the presentinvention, operation is such that in a case where a plurality of inputsignals have been extracted, degree of priority is calculated withregard to each input signal. The extraction of the input signals endswhen the number of input signals stored in the storage device becomeslarger than a predetermined prescribed number or when there are nolonger any input signals to be extracted. In a case where the extractionhas not ended, the above-mentioned determination is performed in regularorder starting from the input signal for which the calculated degree ofpriority is high when a plurality of input signals have been extracted,and is performed with regard to one input signal when one input signalhas been extracted.

As a result, if a plurality of candidates for cause of a failure havebeen extracted, candidates can be limited to that having a high degreeof priority and a faulty detector can be discovered in a shorter periodof time.

In this embodiment, it is preferred that the degree of priority becalculated by performing fuzzy reasoning based upon features obtainedwith regard to each extracted input signal. Accurate inferentialprocessing can be carried out by performing fuzzy reasoning based uponthe features of the input signal, and it is possible to select only acandidate having a high possibility of being the cause of a failure fromamong the extracted plurality of candidates.

In yet another embodiment of the first aspect of the present invention,the control apparatus is constituted by a programmable logic controller,the state of the input signal corresponds to the state of a contact ofthe programmable logic controller, and the state of the output signalcorresponds to the state of a relay of the programmable logiccontroller.

An apparatus for detecting a fault in an actuator according to a secondaspect of the present invention detects the fault through a controlapparatus, which controls a controlled system including one or two ormore detectors and one or two or more actuators, having input-signalmemory means for storing the state of an input signal from the detector,auxiliary input-signal memory means for storing the state of an inputsignal provided by auxiliary-signal generating means, arithmetic-logicmeans for generating an output signal to be applied to the actuator inaccordance with predetermined logic in conformity with the states of theinput signals stored in the input-signal memory means and auxiliaryinput-signal memory means, and output-signal memory means for storingthe state of the output signal generated by the arithmetic-logic means,wherein when there is an actuator not operating normally in thecontrolled system, the actuator is detected through the controlapparatus, the apparatus for detecting the fault comprising firstdetermining means for determining whether a prescribed condition forgeneration of an output signal to be applied to the actuator has beenestablished, second determining means for determining whether the stateof the output signal is normal, and third determining means which, in acase where it has been determined by the first determining means andsecond determining means that the state of the output signal has notbecome normal even upon elapse of a prescribed time from establishmentof the prescribed condition, determines that the actuator to which thisoutput signal is to be applied is faulty.

A method of detecting a fault in an actuator according to the secondaspect of the present invention detects the fault through a controlapparatus, which controls a controlled system including one or two ormore detectors and one or two or more actuators, having input-signalmemory means for storing the state of an input signal from the detector,auxiliary input-signal memory means for storing the state of an inputsignal provided by auxiliary-signal generating means, arithmetic-logicmeans for generating an output signal to be applied to the actuator inaccordance with predetermined logic in conformity with the states of theinput signals stored in the input-signal memory means and auxiliaryinput-signal memory means, and output-signal memory means for storingthe state of the output signal generated by the arithmetic-logic means,wherein when there is an actuator not operating normally in thecontrolled system, the actuator is detected through the controlapparatus, the method of detecting the fault comprising determiningwhether a prescribed condition for generation of an output signal to beapplied to the actuator has been established, determining whether thestate of the output signal is normal, and, in a case where it has beendetermined that the state of the output signal has not become normaleven upon elapse of a prescribed time from establishment of theprescribed condition, determining that the actuator to which this outputsignal is to be applied is faulty.

In accordance with the second aspect of the present invention,monitoring is performed to determine whether a condition for generationof the output signal to be applied to the actuator has been establishedor not. In a case where the state of the output signal is not normalregardless of the fact that the condition has been established, it isjudged that the actuator to which the output signal is applied isfaulty. Accordingly, when there is an actuator not operating normally,this can be detected and specified easily and rapidly.

In an embodiment of the second aspect of the present invention, thecontrol apparatus is constituted by a programmable logic controller, thestate of the input signal corresponds to the state of a contact of theprogrammable logic controller, and the state of the output signalcorresponds to the state of a relay of the programmable logiccontroller.

In this embodiment, it is preferred that all of the determinations bemade by the programmable logic controller. As a result, the actuatorfault detecting function can be installed in the programmable logiccontroller, which is the control apparatus, thereby making integrationpossible.

An apparatus for detecting a fault in an actuator and a detectoraccording to a third aspect of the present invention detects the faultthrough a control apparatus, which controls a controlled systemincluding one or two or more detectors and one or two or more actuators,having input-signal memory means for storing the state of an inputsignal from the detector, auxiliary input-signal memory means forstoring the state of an input signal provided by auxiliary-signalgenerating means, arithmetic-logic means for generating an output signalto be applied to the actuator in accordance with predetermined logic inconformity with the states of the input signals stored in theinput-signal memory means and auxiliary input-signal memory means, andoutput-signal memory means for storing the state of the output signalgenerated by the arithmetic-logic means, wherein when there is anactuator not operating normally in the controlled system, the actuatoris detected through the control apparatus and a detector that ispossibly faulty in the controlled system and a cause of failure of theactuator is detected through the control apparatus, the apparatus fordetecting the fault comprising first determining means for determiningwhether a prescribed condition for generation of an output signal to beapplied to the actuator has been established, second determining meansfor determining whether the state of the output signal is normal, thirddetermining means which, in a case where it has been determined by thefirst determining means and second determining means that the state ofthe output signal has not become normal even upon elapse of a prescribedtime from establishment of the prescribed condition, determines that theactuator to which this output signal is to be applied is faulty,input-signal extracting means for extracting an input signal that hasinfluenced a logical operation, performed by the arithmetic-logic means,which gave rise to the abnormal output signal determined by the thirddetermining means, fourth determining means for determining whether theinput signal extracted by the input-signal extracting means is thesignal that has been stored in the input-signal memory means, and astorage device which, if result of the determination by the fourthdetermining means is that the extracted input signal is the signal thathas been stored in the input-signal memory means, stores theidentification code of this input signal.

A method of detecting a fault in an actuator and a detector according tothe third aspect of the present invention detects the fault through acontrol apparatus, which controls a controlled system including one ortwo or more detectors and one or two or more actuators, havinginput-signal memory means for storing the state of an input signal fromthe detector, auxiliary input-signal memory means for storing the stateof an input signal provided by auxiliary-signal generating means,arithmetic-logic means for generating an output signal to be applied tothe actuator in accordance with predetermined logic in conformity withthe states of the input signals stored in the input-signal memory meansand auxiliary input-signal memory means, and output-signal memory meansfor storing the state of the output signal generated by thearithmetic-logic means, wherein when there is an actuator not operatingnormally in the controlled system, the actuator is detected through thecontrol apparatus and a detector that is possibly faulty in thecontrolled system and a cause of failure of the actuator is detectedthrough the control apparatus, the method of detecting the faultcomprising determining whether a prescribed condition for generation ofan output signal to be applied to the actuator has been established,determining whether the state of the output signal is normal,determining, in a case where it has been determined that the state ofthe output signal has not become normal even upon elapse of a prescribedtime from establishment of the prescribed condition, that the actuatorto which this output signal is to be applied is faulty, extracting aninput signal that has influenced a logical operation, performed by thearithmetic-logic means, which gave rise to the abnormal output signalfor which the fault has been determined, determining whether theextracted input signal is the signal that has been stored in theinput-signal memory means, and, if result of the determination is thatthe extracted input signal is the signal that has been stored in theinput-signal memory means, storing the identification code of this inputsignal.

In accordance with the third aspect of the present invention, detectionof a fault in an actuator is performed in the same manner as in thesecond aspect of the present invention. When it is judged that anactuator is faulty, a candidate for a detector causing the failure ofthe actuator is detected as in the manner of the first aspect of theinvention automatically. As a result, actuator fault detection andextraction of a candidate for a detector that has possibly failed andcaused the fault can be performed in operative association. Actuatorfault detection can be performed easily and rapidly, and extraction of acandidate for failure of the detector causing the fault also can becarried out easily and rapidly.

Preferably, the identification code of the input signal stored in thestorage device is displayed on a display unit. As a result, the user oroperator can visually confirm which input signal has been extracted.

In a preferred embodiment of the third aspect of the present invention,operation is such that in a case where the result of determination isthat the extracted input signal is the signal that has been stored inthe auxiliary input-signal memory means and that it is controlled by thestate of the output signal of the control apparatus, processing forextracting the input signal that has influenced the logical operation,performed by the arithmetic-logic means, which gave rise to the abnormaloutput signal that controls the state of the extracted input signal isrepeated.

As a result, in a case where the extracted input signal is onecontrolled by the state of the output signal of the control apparatus,an input signal that has influenced the logical operation giving rise tothe output signal can also be investigated, and it is also possible todetect a failure in the detector corresponding to the input signal.

Further, in another embodiment of the third aspect of the presentinvention, operation is such that in a case where a plurality of inputsignals have been extracted, degree of priority is calculated withregard to each input signal. The detection of the input signals endswhen the number of input signals stored in the storage device becomeslarger than a predetermined prescribed number or when there are nolonger any input signals to be extracted. In a case where the extractionhas not ended, the above-mentioned determination is performed in regularorder starting from the input signal for which the calculated degree ofpriority is high when a plurality of input signals have been extracted,and is performed with regard to one input signal when one input signalhas been extracted.

As a result, if a plurality of candidates for cause of a failure havebeen extracted, candidates can be limited to that having a high degreeof priority and a faulty detector can be discovered in a shorter periodof time.

In this embodiment, it is preferred that the degree of priority becalculated by performing fuzzy reasoning based upon features obtainedwith regard to each extracted input signal. Accurate inferentialprocessing can be carried out by performing fuzzy reasoning based uponthe features of the input signal, and it is possible to select only acandidate having a high possibility of being the cause of a failure fromamong the extracted plurality of candidates.

In yet another embodiment of the third aspect of the present invention,the control apparatus is constituted by a programmable logic controller,the state of the input signal corresponds to the state of a contact ofthe programmable logic controller, and the state of the output signalcorresponds to the state of a relay of the programmable logiccontroller.

In this embodiment, it is preferred that the determination as to whetherthe prescribed condition for generation of an output signal to beapplied to the actuator has been established, the determination as towhether the state of the output signal is normal and the determinationthat the actuator to which the output signal is to be applied is faultyin a case where the state of the output signal has not become normaleven upon elapse of a prescribed time from establishment of theprescribed condition, are made by the programmable logic controller.

As a result, the actuator fault detecting function can be installed inthe programmable logic controller, which is the control apparatus,thereby making integration possible.

An apparatus for detecting a fault in an input signal according to afourth aspect of the present invention, wherein a control apparatus,which controls a controlled system including one or two or moredetectors and one or two or more actuators, has input-signal memorymeans for storing the state of an input signal from the detector,auxiliary input-signal memory means for storing the state of an inputsignal provided by auxiliary-signal generating means, arithmetic-logicmeans for generating an output signal to be applied to the actuator inaccordance with predetermined logic in conformity with the states of theinput signals stored in the input-signal memory means and auxiliaryinput-signal memory means, and output-signal memory means for storingthe state of an output signal generated by the arithmetic-logic means,wherein when there is an actuator not operating normally in thecontrolled system, an input signal that is possibly abnormal isdetected, the apparatus for detecting the fault comprising a designationinput unit for designating an identification code of an abnormal outputsignal corresponding to the actuator not operating normally,input-signal extracting means for extracting an input signal that hasinfluenced a logical operation, performed by the arithmetic-logic means,which gave rise to the abnormal output signal designated by thedesignation input unit, and a storage device for storing theidentification code of the input signal extracted by the input-signalextracting means.

A method of detecting a fault in an input signal according to a fourthaspect of the present invention, wherein a control apparatus, whichcontrols a controlled system including one or two or more detectors andone or two or more actuators, has input-signal memory means for storingthe state of an input signal from the detector, auxiliary input-signalmemory means for storing the state of an input signal provided byauxiliary-signal generating means, arithmetic-logic means for generatingan output signal to be applied to the actuator in accordance withpredetermined logic in conformity with the states of the input signalsstored in the input-signal memory means and auxiliary input-signalmemory means, and output-signal memory means for storing the state of anoutput signal generated by the arithmetic-logic means, wherein whenthere is an actuator not operating normally in the controlled system, aninput signal that is possibly abnormal is detected, the method ofdetecting the fault comprising designating an identification code of anabnormal output signal corresponding to the actuator not operatingnormally, extracting an input signal that has influenced a logicaloperation, performed by the arithmetic-logic means, which gave rise tothe designated abnormal output signal, and storing the identificationcode of the extracted input signal in a storage device.

In accordance with the fourth aspect of the present invention, operationis such that when the identification code of an abnormal output signalcorresponding to an actuator that does not operate normally isdesignated, the input signal that has influenced the logical operationwhich produces the designated abnormal output signal is extracted. Theextracted input signal is stored in the storage device.

Accordingly, in a case where the actuator does not operate normally, allcandidates for an abnormal input signal that is the cause can bedetected and specified easily and in a short period of time.

Preferably, the identification code of the input signal stored in thestorage device is displayed on a display unit. As a result, the user oroperator can visually confirm which input signal has been extracted.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the constructions of a faultdetecting apparatus, a PLC and a controlled system;

FIG. 2 is a structural view showing an example of the controlled system;

FIG. 3 is a ladder diagram showing an example of a user program;

FIG. 4 is a ladder diagram showing an example of a user program;

FIGS. 5 and 6 are flowcharts illustrating the flow of processing fordetecting failure of a detector;

FIGS. 7 and 8 are flowcharts illustrating the flow of processing forextracting and storing contacts in an OFF state;

FIGS. 9 and 10 are flowcharts illustrating the flow of processing forextracting and storing contacts in an ON state;

FIGS. 11 and 12 are flowcharts illustrating the flow of processing forautomatically selecting contacts that possibly are faulty in ladderprogram;

FIGS. 13a through 13c show the structure of a stack;

FIG. 14 is a ladder diagram showing an example of a ladder program;

FIGS. 15a through 15f show membership functions of contact features 1through 6;

FIG. 16a shows fuzzy reasoning rules for obtaining degree of priority ofa contact, and FIG. 16b shows a membership function of the consequentsof the rules shown in FIG. 16a;

FIG. 17a is a ladder diagram showing an example of a ladder program, andFIG. 17b shows the values of contact features 1 through 6 in FIG. 17a;

FIG. 18a illustrates degrees of membership of antecedents andconsequents in a case where fuzzy reasoning is performed with regard tothe contacts of FIG. 17a, and FIG. 18b illustrates degrees of priorityof the contacts obtained by fuzzy reasoning;

FIG. 19 is a flowchart showing the flow of processing for detectingfailure of an actuator;

FIG. 20 is a ladder diagram illustrating an example of a ladder programto which a function for detecting failure of an actuator has been added;

FIGS. 21 and 22 are flowcharts showing the flow of processing fordetecting failure of an actuator and detector;

FIGS. 23 and 24 are flowcharts showing the flow of processing fordetecting failure of internal auxiliary contacts and special auxiliarycontacts or programming error;

FIGS. 25 and 26 are flowcharts showing the flow of processing forextracting and storing contacts other than internal auxiliary contacts;and

FIG. 27 is a ladder diagram showing an example of a ladder program.

BEST MODE FOR CARRYING OUT THE INVENTION

I. Fault detecting apparatus and control system

FIG. 1 is a block diagram illustrating the construction of a faultdetecting apparatus 1 and of a control system comprising a PLC 2 and acontrolled system 3 controlled by the PLC 2.

The fault detecting apparatus 1 detects failure of detectors 31a . . .31n (sensors and switches such as proximity switches, limit switches andphotoelectric detectors) and actuators 33a . . . 33n (air cylinders,hydraulic cylinders, motors, etc.) of the controlled system 3, anddetects abnormality in the contacts of the PLC 2. The fault detectingapparatus 1 is constructed as a unit separate from the PLC proper. Ofcourse, all of the functions of the fault detecting apparatus 1 can beincorporated in the PLC proper so that the fault detecting apparatus 1and PLC 2 may be constructed as a single body.

The fault detecting apparatus 1 is constituted by a CPU 11, a ROM 12, aRAM 13, a keyboard 14, a display unit 15 and an interface circuit 16.These devices are interconnected by a system bus 17.

The ROM 12 stores a program for detecting faulty locations and a programfor controlling devices (the keyboard 14, display unit 15, etc.)constructing the fault detecting apparatus 1.

In accordance with the programs that have been stored in the ROM 12, theCPU 11 executes fault detecting processing and controls each of thedevices constructing the fault detecting apparatus 1.

The RAM 13 temporarily stores data resulting from the processingexecuted by the CPU 11, data entered by the user or operator (user) viathe keyboard 14, and data that is input/output between the faultdetecting apparatus and the PLC 2 via the interface circuit 16.

The keyboard 14 is for allowing the user to enter data. The entered datais the number of an output relay or the number of a contact, etc., of aladder circuit, as will be set forth later.

The display unit 15, which is for displaying the results of faultdetection processing, is constituted by a CRT or the like. For example,the number of a contact extracted as the cause of a failure is displayedas the result of fault detection processing.

The interface circuit 16 carries out data communication between thefault detecting apparatus 1 and the PLC 2 via an interface bus 18, andperforms control for data communication.

The PLC 2 is constituted by a CPU 21, a ROM 22, a RAM 23, an interfacecircuit 24 and an I/O unit 25. These devices are interconnected by asystem bus 26.

A ladder-control system program is stored in the ROM 22.

A user program (ladder program) created by the user in order to controlthe controlled system is stored in part of the area of the RAM 23, andan I/O table holding the ON, OFF states of actual input/output signalsof the PLC is stored in the other part.

The CPU 21 controls the controlled system 3 in accordance with theladder-control system program stored in the ROM 22 and the user programstored in the RAM 23.

The interface circuit 24 is connected to the interface circuit 16 of thefault detecting apparatus 1 by the interface bus 18 and, as set forthabove, performs data communication between the fault detecting apparatus1 and PLC 2 and carries out control for data communication.

The I/O unit 25 sends and receives input/output signals to and from thedetectors and actuators of the controlled system 3 via a PLC I/O databus 27.

Though the details will be described later, the controlled system 3 isequipped with a plurality of detectors for detecting workpieces or burrson the workpieces, and a plurality of actuators for controllingpneumatic cylinders, which remove defective workpieces, or drillingmotors. These detectors and actuators send and receive input/outputsignals to and from the I/O unit 25 of the PLC 2 via the PLC I/O databus 27.

II. Construction of controlled system and example of control thereof

FIG. 2 shows an example of the controlled system 3.

Workpieces W are conveyed by a conveyor 91, which is driven by a firstmotor (M1) 72. Detection of the presence of workpieces W and detectionof burrs on the workpieces W is performed automatically at points alongthe conveyor 91. A first workpiece detector 55 and a burr detector 56are provided for these purposes. If it is detected that a workpiece Whas a burr or that a burr is larger than a prescribed quantity, thisworkpiece is removed from the conveyor 91 by a defect-rejectingpneumatic cylinder 73. Rotation of the motor 72 is halted duringoperation of the cylinder 73, thereby stopping the conveyor 91.

A workpiece W conveyed to the end of the conveyor 91 by the conveyor isshifted onto a conveyance base 92. A retention detector 57 is providedfor detecting the workpiece W that has been conveyed to the proximity ofthe end of the conveyor 91. If detection of the workpiece W by theretention detector 57 continues for more than a fixed period of time, anabnormality lamp 71 lights on a control panel 90.

A second workpiece detector 58 is provided in order to detect theworkpiece W that has been shifted onto the conveyance base 92. When theworkpiece W is detected by the workpiece detector 58, a carry-inpneumatic cylinder 75 is driven so that the workpiece W is pushed alongthe conveyance base 92 toward a machining table 93 by a rod provided inthe carry-in pneumatic cylinder 75. The workpiece W transferred to themachining table 93 is detected by a third workpiece detector 61.

When the workpiece W is transferred to the machining table 93, a jig 77that secures the workpiece W is driven in a direction in which it willclamp the workpiece. Further, a second motor (72) 78 is driven intorotation so that a drill 79 secured to the rotary shaft of the motor 78will descend along with the motor 78 and drill a hole in the workpieceW. After the drilling operation, the drill 79 is raised along with themotor 78 and rotation of the motor 78 is halted. The drilled workpieceis ejected from the machining table 93 by an ejecting pneumatic cylinder81.

The control panel 90 is provided with an operation switch 50, a stopswitch 51, a removal switch 52, an in-operation lamp 70 and anabnormality lamp 71. By turning on the operation switch 50, theabove-described series of steps that commences with start-up of themotor 72 begins and the in-operation lamp 70 lights. When the stopswitch 51 is turned on, the operations performed in the above-mentionedsteps halt and the in-operation lamp 70 is extinguished. When thedetection signal from the detector 57 continues in excess of the fixedperiod of time, as set forth above, the abnormality lamp 71 lights andthe in-operation lamp 70 is extinguished. If the removal switch 52 isturned on in this state, the abnormality lamp 71 is extinguished.

The defect-rejecting pneumatic cylinder 73 is provided with a defectforward-end detector for detecting that the cylinder rod has beenadvanced (forwarded) to a forward end, and with a defect rearward-enddetector for detecting that the cylinder rod has been retracted to arearward end. (Neither of the detectors is shown.) Similarly, thecarry-in cylinder 75 is provided with a carry-in forward-end detectorand a carry-in rearward-end detector, and the ejecting pneumaticcylinder 81 is provided with an ejection forward-end detector and anejection rearward-end detector (none of these detectors being shown).Furthermore, there are provided a drill upper-end detector for detectingthat the drill 79 (as well as the motor 78 in which the drill ismounted) has ascended to its raised end, and a drill lower-end detectorfor detecting that the drill 79 (as well as the motor) has descended toits lowered end. (Neither of the detectors is shown.)

The signals which enter the PLC 2 from the controlled system 3 are asfollows, where (000) to (015) at the head are the numbers of the inputsignals and the wording within the parentheses at the tail is anabbreviated expression:

(000) ON/OFF signal of operation switch 50 (operation SW)

(001) ON/OFF signal of stop switch 51 (stop SW)

(002) ON/OFF signal of removal switch 52 (removal SW)

(003) detection signal from defect forward-end detector (defect forwardend)

(004) detection signal from defect rearward-end detector (defectrearward end)

(005) workpiece detection signal from first workpiece detector 55(detection 1)

(006) burr detection signal from burr detector 56 (burr detection)

(007) detection signal from retention detector 57 (retention detection)

(008) workpiece detection signal from second workpiece detector 58(detection 2)

(009) detection signal from carry-in forward-end detector (carry-inforward end)

(010) detection signal from carry-in rearward-end detector (carry-inrearward end)

(011) workpiece detection signal from third workpiece detector 61(detection 3)

(012) detection signal from drill upper-end detector (drill upper end)

(013) detection signal from drill lower-end detector (drill lower end)

(014) detection signal from ejection forward-end detector (ejectionforward end)

(015) detection signal from ejection rearward-end detector (ejectionrearward end)

The signals output from the PLC 2 to the controlled system 3 are asfollows, where (100) to (012) at the head are the numbers of the outputsignals and the wording within the parentheses at the tail is anabbreviated expression:

(100) ON/OFF control signal of in-operation lamp 70 (in-operation L)

(101) ON/OFF control signal of abnormality lamp 71 (abnormality L)

(102) rotating-drive control signal of first motor 72 (M1 rotation)

(103) advance-drive control signal of defect-rejecting cylinder 73(defect advance)

(104) retraction-drive control signal of defect-rejecting cylinder 73(defect retraction)

(105) advance-drive control signal of carry-in cylinder 75 (carry-inadvance)

(106) retraction-drive control signal of carry-in cylinder 75 (carry-inretraction)

(107) clamping-drive control signal of fixing jig 77 (jig clamp)

(108) rotating-drive control signal of second motor 78 (M2 rotation)

(109) raising-drive control signal of drill 79 (drill ascent)

(110) lowering-drive control signal of drill 79 (drill descent)

(111) advance-drive control signal of ejecting cylinder 81 (ejectionadvance)

(112) retraction-drive control signal of ejecting cylinder 81 (ejectionretraction)

FIGS. 3 and 4 illustrate part of a program (user program) stored in theRAM 23 of PLC 2. The program is represented using contacts turned ON andOFF by input signals, output relays for generating output signals,contacts turned ON and OFF by the output relays, internal auxiliaryrelays and their contacts.

The meaning of the internal auxiliary relays and their contactsillustrated in FIGS. 3 and 4 is as follows: "CURRENTLY SET" representsthe start of overall drilling machining; the relay or contact is 0Nuntil completion of drilling and ejection of the workpiece. "SETTINGCOMPLETED" represents that setting of the workpiece on the machiningtable has been completed. "MACHINING COMPLETED" represents that ejectionof the workpiece from the machining table has been completed. "CARRY-INSTORED" represents that the workpiece has been carried in to themachining table; the relay and contact are ON until machining andejection of the workpiece have been completed. "DRILLING IN PROGRESS"represents that the workpiece has been set on the machining table; therelay and contact are ON until drilling is completed. "DRILLINGCOMPLETED" represents that drilling of the workpiece has been completed."DRILLING STORED" represents that the drill has drilled the workpiece;the contact is ON until the completion of drilling.

III. Fault detection processing by fault detecting apparatus

(1) Processing for detecting faulty detectors

FIGS. 5 and 6 are flowcharts illustrating the flow of processing throughwhich the fault detecting apparatus 1 detects a candidate for a detectorthat is possibly faulty in a case where a failure has developed in adetector of the controlled system 3. FIGS. 7 and 8 are flowchartsillustrating the detailed flow of processing of a step 304 in FIG. 5.FIGS. 9 and 10 are flowcharts illustrating the detailed flow ofprocessing of a step 305 in FIG. 5.

A user specifies an actuator that does not perform a prescribedoperation in the controlled system 3. The user specifies the relay(output relay) applying the signal to this actuator and enters theinformation (e.g., the relay number) specifying this output relay intothe fault detecting apparatus 1 using the keyboard 14 (step 301). TheCPU 11 stores the entered relay number in the RAM 13.

Next, using the keyboard 14, the user enters into the fault detectingapparatus 1 whether the proper state that is to be established at thedesignated relay is the ON (closed) or OFF (open) state (step 302). Thisstate also is stored in the RAM 13 by the CPU 11.

If the designated relay is in the OFF state regardless of the fact thatit is originally intended to be in the ON state (YES at step 303), thenan OFF contact that is the cause of this condition should be among thecontacts that have been connected to the designated relay. Therefore,OFF contacts are extracted and stored in the RAM 13 (step 304). If thedesignated relay is in the ON state regardless of the fact that it isoriginally intended to be in the OFF state (NO at step 303), then an ONcontact that is the cause of this condition should be among the contactsthat have been connected to the designated relay. Therefore, 0N contactsare extracted and stored in the RAM 13 (step 305).

Extraction of the contacts is carried out by the CPU 11, which accessesthe PLC 2 using the interface circuit 16 and interface bus 18 andsearches the ladder program that has been stored in the RAM 23 of thePLC 2. Verification of the ON or OFF state of an extracted contact iscarried out by searching the I/O table holding the ON, OFF states ofeach of the contacts in the ladder program. The details of theprocessing executed at steps 304, 305 will be described later.

All contacts extracted and stored in the RAM 13 are displayed on thedisplay unit 15 to inform the user (step 306).

In a case where a plurality of contacts are displayed on the displayunit 15 (YES at step 307), the user selects one contact from among thedisplayed contacts, and information (e.g., the contact number) whichdesignates this contact is entered into the fault detecting apparatus 1using the keyboard 14 (step 308). If one contact is displayed (NO atstep 307), then this contact is selected automatically by the CPU 11.

The fact that the contact has been selected is written in the RAM 13 bythe CPU 11 with regard to the selected contact (e.g., a flag indicatingthat the contact has been selected is set) so that selection of the samecontact will not occur in subsequent processing (step 309).

Next, it is determined whether the selected contact is an actual inputcontact (step 310). The term "actual input contact" refers to a contactwhich represents the state of the input signal applied to it from thedetector of the controlled system 3.

The determination as to whether the contact is an actual input contactor not can be performed by storing a table, in which the numbers of theactual input contacts have been registered, in the RAM 13 or RAM 23 inadvance, and checked to see whether the number of the selected contactresides in this table. If the number of the selected contact resides inthe table, then this contact is an actual input contact. Alternatively,the foregoing can be performed by searching the ladder program todetermine whether there is a relay whose number is the same as that ofthe contact. If there is a relay whose number is identical with that ofthe selected contact, then this contact is not an actual input contact.In FIG. 3, the contact 105 at address 00048 in the ladder circuit is notan actual input contact because there is relay 105 having the samenumber located at address 00039.

In a case where the selected contact is an actual input contact (YES atstep 310), the fact that this contact is a candidate for cause offailure is displayed on the display unit 15 to so inform the user (step311).

Next, whether the contacts stored in the RAM 13 include a contact thathas not been selected is determined by the CPU 11 (step 312). If anunselected contact does reside in the RAM 13 (YES at step 312), the usermakes an entry as to whether or not investigation of other contacts ascause of failure is to continue. In a case where investigation of othercandidates is to continue (YES at step 313), then processing from step307 is repeated in order perform the processing for other contacts.

Processing is terminated in a case where unselected contacts do notremain in the RAM 13 (NO at step 312) or in a case where investigationof other candidates is not to continue (NO at step 313).

In a case where the selected contact is not an actual input contact atstep 310, it is determined whether this contact is an internal auxiliarycontact (step 314).

The term "internal auxiliary contact" refers to a contact which is notan actual input contact (a contact representing the state of the inputsignal from the detector in the controlled system 3) but a contactcontrolled by an output relay or internal auxiliary relay. Whether ornot a contact is an internal auxiliary contact can be determined bychecking to see whether a relay having the same number as that of thiscontact is present in the ladder program. If there is a contact having anumber the same as that of this contact, then this contact is aninternal auxiliary contact.

In a case where the selected contact is an internal auxiliary contact(YES at step 314), a relay (an output relay or internal auxiliary relay)having the same number as that of this contact is retrieved (step 315).This is because the fact that the internal auxiliary contact is thecause of a failure is considered to mean that the contact connected tothe relay that controls the state of this internal auxiliary contact isthe cause of the failure. The processing from step 303 onward isrepeated in order to extract a contact that is a candidate for the causeof the failure from among the contacts that have been connected to theretrieved relay and to store this contact in the RAM 13.

In a case where the selected contact is not an actual input contact andis not an internal auxiliary contact (NO at step 314), processingregarding this contact is not executed and processing from step 312onward is executed in order to execute processing with regard to theother contacts that have been stored in the RAM 13.

An example of a component which is not an actual input contact and notan internal auxiliary contact is a special auxiliary contact or linkrelay, etc.

A special auxiliary contact is a contact whose 0N or OFF state iscontrolled by the ladder-control system program or the like. Forexample, such contacts include a contact whose state is controlled by aclock signal or whose state is decided by an operational instruction ora flag. A link relay is a contact the state of which is controlled by aPLC other than the PLC 2 via communication means.

These contacts are not subjected to processing because they do not takepart in fault detection of the detectors in the controlled system 3.

The details of the processing of step 304 will now be described on thebasis of FIGS. 7 and 8. In a case where a relay is in the OFF stateregardless of the fact that it should be in the ON state, the processingof step 304 extracts a contact in the OFF state as the cause.

As one example a case will be considered in which the carry-in cylinder75 in FIG. 2 remains in an advanced state and will not retract.

In response to the fact that the carry-in cylinder 75 will not retract,the user ascertains that the carry-in retraction signal 106, namely theoutput relay 106 (carry-in retraction) in FIG. 3, is abnormal (OFF) anduses the keyboard 14 to enter the number of the output relay 106 intothe fault detecting apparatus 1.

As set forth above, first a contact is extracted by searching the userprogram (ladder program) that has been stored in the RAM 23. Next, theON or OFF state of the contact is checked by searching the I/O tablethat has been stored in the RAM 23. If the state of the contact is OFF,this contact is stored in the RAM 13.

Processing for extracting a contact will now be described in accordancewith the ladder diagram of FIG. 3.

An OFF contact, which is a candidate for cause of a failure, isextracted by searching the ladder circuit (ladder program) from theoutput relay 106 to a bus-line R (FIG. 3).

First, the search point is advanced along line L1 (FIG. 3) from therelay 106 toward the bus-line R and a determination is made as towhether a branch point (branch point P1 in FIG. 3) at which contactshave been connected in parallel has been passed (step 321). In a casewhere the ladder program is expressed in the form of mnemonic symbols,the search in the program describing an individual ladder diagram iscarried out from an OUT instruction to an LD instruction (loadinstruction). If an OR instruction or OR LD instruction (OR loadinstruction) is contained in the program, it is understood that a branchpoint has been reached.

Since the contacts 105 and 010 are located ahead of the branch point P1,the search point does not pass the branch point (NO at step 321) and thecontact 105 is extracted (step 323).

Next, it is determined whether the extracted contact 105 is in the ONstate or not (step 324). Assume that the contact 105 is in the OFFstate. In this case (NO at step 324), the number 105 of the contact andthe number 106 of the designated relay are compared (step 325). Sincethe two numbers do not agree in this case (NO at step 326), the contact105 is stored in the RAM 13 as a candidate for cause of failure (step327).

The reason for comparing the number of the extracted contact and thenumber of the designated relay is to exclude self-holding contacts frombeing the object of extraction. For example, the contact 106 is aself-holding contact of relay 106, and the contact 106 also is turned ONand OFF by the turning ON and OFF of the relay 106. Accordingly, it isunnecessary for the self-holding contact to be adopted as an object ofextraction.

Next, it is determined whether the search point has reached the bus-lineR of the ladder circuit (step 328). In mnemonic representation, it isunderstood that the bus-line has been reached if there is an LDinstruction (load instruction).

Since the search point has not reached the bus-line R (NO at step 328),processing is repeated from step 321. The contact 010 is extracted andit is determined whether the contact 010 is in the ON state (steps 321to 324) in the same manner as in the case of the contact 105. Assumethat the contact 010 is in the ON state. In this case (YES at step 324),the contact 010 is not deemed to be a contact causing failure and thecontact is not stored in the RAM 13.

When the search point advances further toward the bus-line R from thecontact 010, it passes the branch point P1 (YES at step 321) and, hence,the branch point P1 is stored in the RAM 13 (step 322). One line L2branching from the branch point P1 is selected and the contact 009 isextracted (step 323). Assume that the contact 009 is in the OFF state.The branch point 009 is stored in the RAM 13 as a candidate for cause offailure (steps 324 to 327).

When the search point advances along the line L2, it reaches thebus-line R (YES at step 328) and therefore it is determined whetherthere is a branch point that has been stored (step 329). Since branchpoint P1 has been stored (YES at step 329), the search point is moved tothe branch point P1 stored most recently (stored last) (step 330). (Inthis embodiment, branch point P1 is the sole branch point and thereforeis the branch point stored most recently.) The branch point P1 is thenerased from the RAM 13 (step 331).

The search point is moved from the branch point P1 along one other lineL3 and extraction of the contact is performed (steps 321 to 323).Contact 106 is extracted on line L3. However, since this contactconstructs a self-holding circuit together with the relay 106, asmentioned above, the contact is not stored in the RAM 13 even if thecontact is OFF (YES at step 326).

The search point reaches the bus-line R on line L3 (YES at step 328)and, since there are no stored branch points (NO at step 329),processing for extracting contacts that are the cause of failure ends.

The contacts extracted and stored in the RAM 13 are contacts 105 and009. The processing from step 306 onward in FIG. 5 is applied to thesecontacts as set forth above. In a case where the contact 105 has beenselected at step 308, the relay 105 is retrieved at step 315 because thecontact 105 is an internal auxiliary contact. The ON, OFF states of thecontacts 204, 106 and so on connected to the relay 105 also areinvestigated and, if a contact is in the OFF state, it is stored in theRAM 13.

Next, the details of the processing of step 305 will be described on thebasis of FIGS. 9 and 10. In a case where a relay is in the ON stateregardless of the fact that it should be OFF, the processing of step 305extracts an ON contact as the cause.

As one example a case will be considered in which the drill 79 in FIG. 2remains in a lowered state and will not ascend.

In response to the fact that the drill 79 will not ascend, the userascertains that the drill descent signal 110, namely the output relay110 (drill descent) in FIG. 4, is abnormal (ON state) and uses thekeyboard 14 to designate the relay 110.

An ON contact that is a candidate for cause of failure is extracted bysearching the ladder circuit from the designated relay 110 to a bus-lineR.

First, the search point is advanced along line L4 (FIG. 4) from therelay 110 toward the bus-line R and a determination is made as towhether a branch point (branch point P2 in FIG. 4) at which contactshave been connected in parallel has been passed (step 341). Since thecontacts 109 and 013 are located ahead of the branch point P2, thesearch point does not pass the branch point (NO at step 341) and thecontact 109 is extracted (step 343).

Next, it is determined whether the extracted contact 109 is in the OFFstate or not (step 344). Assume that the contact 109 is in the ON state.In this case (NO at step 344), the number 109 of the contact and thenumber 110 of the designated relay are compared (step 345). Since thetwo numbers do not agree in this case (NO at step 346), the contact 109is stored in the RAM 13 as a candidate for cause of failure (step 347).This is to exclude self-holding contacts from being the object ofextraction, mentioned earlier.

Next, it is determined whether the search point has reached the bus-lineR of the ladder circuit (step 351). Since the search point has notreached the bus R (NO at step 351), processing is repeated from step341. The contact 013 is extracted in the same manner as in the case ofthe contact 109. If it is assumed that the contact 013 is in the ONstate, then the contact 013 is stored in the RAM 13 (steps 314 to 347).

When the search point advances further toward the bus-line R from thecontact 013, it passes the branch point P2 (YES at step 341) and, hence,the branch point P2 is stored in the RAM 13 (step 342). The search pointadvances on one line L5 from the branch point P2 and the contact 012 isextracted (step 343). Assume that the contact 012 is in the ON state.The branch point 012 is stored in the RAM 13 as a candidate for cause offailure (steps 344 to 347).

Next, the contact 209 is extracted and, if it is assumed that thecontact 209 is in the ON state, the contact 209 also is stored in theRAM 13.

Next, the contact 107 is extracted (step 343). Assume that this contactis in the OFF state. In this case (YES at step 344), among the contactsthat have been stored in the RAM 13, the contacts 209 and 012, which arebetween the extracted contact 107 and the branch point P2, are erasedfrom the RAM 13 (step 348). The reason for this is as follows: If anycontact on the line L5 between the branch point P2 and the bus-line R isin the OFF state, the overall state of the line L5 is OFF even if theother contacts on this line are ON. Since this acts to place the relay110 in the OFF state, the contacts on line L5 are not considered to bethe cause of failure. In this case, the contact that is the cause offailure is present on line L4 or line L6.

Next, the search point moves to the branch point P2 stored most recently(last) (step 349). The branch point P2 is erased from the RAM 13 (step350).

Next, contact 110 is extracted on line L6 (step 343). However, sincethis contact is a self-holding circuit (YES at step 346), as mentionedabove, the contact is not stored in the RAM 13.

The search point reaches the bus-line R (YES at step 351) and, sincethere are no stored branch points (NO at step 352), processing forextracting contacts that are the cause of failure ends.

The contacts extracted and stored in the RAM 13 are contacts 109 and013. The processing from step 306 onward in FIG. 5 is applied to thesecontacts as set forth above.

Thus, regardless of whether a designated relay is ON or OFF, a contactthat is a candidate for cause of failure can be extracted automaticallyfrom among the contacts connected to this relay. In a case where anextracted contact is an actual input contact, the user is so informed.As a result, a detector corresponding to this actual input contact, andwhich is possibly causing a failure, can be specified easily andrapidly.

(2) Automatic selection of contacts

If a plurality of contacts are extracted as candidates for cause offailure in the above-described processing for extracting contacts assuch candidates, this result is presented to the user, who then selectsone contact from these contacts (step 308 in FIG. 5).

Selection of this contact can also be carried out automatically.

(2-1) Overview of processing

FIGS. 11 and 12 are flowcharts showing the flow of processing forautomatically selecting a contact. As one example, a case will beconsidered in which the relay 110 (drill descent) in FIG. 4 is in theOFF state regardless of the fact that it should be ON.

The user specifies the actuator which does not perform the prescribedoperation in the controlled system 3 and specifies the relay 110corresponding to this actuator in the ladder program.

The user enters the information (the relay number, etc.) designating thespecified relay into the fault detecting apparatus 1 using the keyboard14 (step 401). The CPU 11 stores the designated relay number in the RAM13. Further, the fact that the designated relay 110 has been selected iswritten in the RAM 13 by the CPU 11 (step 402). For example, a flagindicating that this relay has been selected is prepared in the RAM 13and this flag is set.

Next, using the keyboard 14, the user enters into the fault detectingapparatus 1 whether the proper state that is to be established at therelay 110 is the 0N state or OFF state (the ON state in this example)(step 403). This state also is stored in the RAM 13 by the CPU 11.

If the relay 110 is in the OFF state regardless of the fact that it isoriginally intended to be in the 0N state (YES at step 404), then an OFFcontact among the contacts that have been connected to the designatedrelay is extracted and stored in the RAM 13 (step 405). If thedesignated relay is in the ON state regardless of the fact that it isoriginally intended to be in the OFF state (NO at step 404), then an ONcontact that is the cause of this condition is extracted from among thecontacts that have been connected to the designated relay, and thiscontact is stored in the RAM 13 (step 406). This processing is similarto that of FIGS. 7 to 10 described above.

Assume that contacts 107, 209 and 013 have been extracted and stored inthe RAM 13 by the processing of step 405. Since a plurality of contactshave been stored in the RAM 13 (YES at step 407), the features(described in detail later) of these contacts that have been stored inthe RAM 13 are obtained (step 411). Inferential processing is applied toeach of these contacts on the basis of these features and the degree ofpriority (described in detail later) is determined (step 412).

The numbers of the contacts, the relay to which these contacts have beenconnected and the degrees of priority of these contacts are correlatedand stored (pushed) in a stack within the RAM 13 (step 413).

FIG. 13a illustrates the data thus stored in the stack. As shown in FIG.13a, it is assumed that the degrees of priority of the contacts 107, 209and 013 are 0.9, 0.7 and 0.5, respectively. Further, data having smallervalues of degree of priority are stacked at the bottom and data havinghigher values of degree of priority are stacked at the top. In otherwords, the items of data are pushed onto the stack in regular order fromthe data having smaller values of degree of priority.

Next, the data that has been stored in the stack is popped (step 414).That is, the contact 107 having the highest degree of priority among thecontacts stored in the stack is extracted. As a result, the data ofcontacts 209 and 013 remain in the stack of RAM 13, as illustrated inFIG. 13b.

Next, it is determined whether the extracted contact 107 is an actualinput or not (step 408). Since the contact 107 is not an actual inputcontact (NO at step 408), it is determined whether the contact 107 is aninternal auxiliary contact (step 409). Since the contact 107 is aninternal auxiliary contact (YES at step 409), the relay 107 thatcontrols the state of this contact is retrieved (step 415).

It is then determined whether the retrieved relay 107 has already beenselected (step 416). In a case where the relay 107 has already beenselected (YES at step 416), the contact connected to the relay 107 isone that has already been investigated and therefore is not investigatedhere.

In a case where the relay 107 has not been selected (NO at step 416),processing from step 402 is repeated in order to carry out processingregarding contacts that have been connected to the relay 107. Thecontact 205 is the only contact connected to the relay 107. Assume thatthe contact 205 is in the OFF state. The contact 205 is extracted andstored in the RAM 13 at step 405.

The contact stored in the RAM 13 is solely the contact 205 (NO at step407) and this relay is an internal auxiliary contact (NO at step 408 andYES at step 409). Accordingly, the relay 205 that controls the state ofthe contact 205 is retrieved, the OFF contacts connected to the relay205 are extracted and these contacts are stored in the RAM 13 (steps 402to 405).

Assume here that the contacts stored in the RAM 13 are the contacts 011and 204, and that the degrees of priority of these contacts are 0.9 and0.6, respectively. In this case, the stack of RAM 13 is as shown in FIG.13c owing to the processing of step 413.

Next, the data of contact 011 is popped from the stack (step 414). Sincethis contact is an actual input contact (YES at step 408), the contact011 is stored in RAM 13 as a candidate for cause of failure (step 410).

It is then determined whether the number of contacts stored ascandidates for cause of failure has reached a predetermined prescribednumber (step 417). This prescribed number is entered into the faultdetecting apparatus 1 beforehand by the user. This is to arrange it sothat processing for detecting candidates for cause of failure will beterminated in a case where the prescribed number of contacts has beenselected.

Next, it is determined whether the stack is empty, i.e., whether thereis no data that will pop from the stack (step 418). Since there is datarelating to the contacts 204, etc., in the stack, processing is repeatedfrom step 414.

In a case where it has been determined at step 417 that the contactsstored as candidates for cause of failure is of the prescribed number,or in a case where it has been determined at step 418 that the stack isempty, processing ends.

In a case where the designated contact is not an internal auxiliarycontact (e.g., is a special auxiliary contact) (NO at step 409), thiscontact is not related to detection of failure of a detector andtherefore is not processed. Processing is then repeated from step 418.

It should be noted that storage of contacts may of course be performedby another data structure without relying upon a stack.

(2-2) Contact features

The above-mentioned features are as follows:

Feature 1! Nature of contact

The nature of a contact indicates that the contact is an actual inputcontact (J), an internal auxiliary contact or a special auxiliarycontact (T).

Feature 2! Position of contact in ladder circuit

The position of a contact in a ladder circuit is the order indicatingthe number of the contact counting from the bus-line R of the laddercircuit. For example, in FIG. 14, contact 02 is situated at the secondposition counting from the bus-line R, and therefore the position ofthis contact in the ladder circuit is 2. The position of contact 05 inthe ladder circuit is 1.

Feature 3! Form of connection of contact

The form of a contact connection indicates whether the contact is (A)serially connected or (O) parallel connected. For example, in FIG. 14,contacts 01, 02 and 03 are serially connected and therefore the form ofthe connection of these contacts is serial. On the other hand, contact05 is not a contact serially connected to its neighbor but is connectedin parallel with contacts 01, 02 and 03 and with contacts 06 and 07.Accordingly, the form of connection of contact 05 is parallel.

Feature 4! Type of contact

Contact type indicates whether the contact is an a contact (a) or a bcontact (b).

Feature 5! Number of rungs to actual input contact

The number of rungs to an actual input contact may be understood asfollows: By way of example, in order to start from contact 09, which isan internal auxiliary contact in FIG. 14, and reach contact 04, which isan actual input contact that influences the state of the contact 09, thetwo rungs of the individual ladder circuits L02 and L01 must betraversed. Accordingly, the number of rungs from contact 09 to theactual input contact is two.

Feature 6! Remaining number of contacts for relay to attain normal state(ON or OFF state)

By way of example, in a case where relay 08 in the individual laddercircuit L01 of FIG. 14 is in the OFF state regardless of the fact thatit should be ON, the relay 08 will attain the ON state if contact 02 inline A attains the ON state. In this case, therefore, with regard tocontact 02, the number of contacts that remain in order for the relay toattain the normal state is one.

Similarly, with regard to contacts 06 and 07, relay 08 will attain theON state if these two contacts do, and therefore the remaining number ofcontacts with regard to each of contacts 06 and 07 is two. The remainingnumber of contact with regard to contact 05 is one.

In a case where degree of priority of a contact is obtained, any one ofthese features may be used to obtain it or two or more features may becombined to obtain the degree of priority. Furthermore, features ofcontacts other than Features 1 through 6 may be used.

(2-3) Inferential processing

FIGS. 15a through 15f illustrate examples of membership functions ofrespective ones of Features 1 through 6.

FIG. 16a shows an example of rules in a case where the degree ofpriority of each contact is obtained by fuzzy reasoning. FIG. 16b showsan example of a membership function of degree of priority.

Rule 1 states that "If the position of the contact in the ladder circuit(Feature 2) is near the bus-line R (NB) and the type of the contact(Feature 4) is an a contact (a)" (antecedent), "then the degree ofpriority of this contact is made high (PB)" (consequent).

In other words, generally the more important the contact, the closer thecontact is placed to the bus-line R. In addition, generally theinfluence exerted upon a change in the state of the relay connected tothe a contact is greater than for that connected to the b contact.Therefore, the degree of priority of such a contact is made high anddetection of this contact is performed preferentially.

Rule 2 states that "If the nature of the contact (Feature 1) is that itis an actual input contact (J)" (antecedent), "then the degree ofpriority of this contact is made high (PB)" (consequent).

This is for the purpose of preferentially detecting an actual inputcontact that is possibly faulty. In a case where the contact is aninternal auxiliary contact, it is necessary to retrieve the relaycorresponding to this contact and investigate the contacts connected tothis relay. This investigation is time consuming. On the other hand, ina case where the contact is an actual input contact, it is unnecessaryto retrieve another relay. Therefore, by investigating the actual inputcontact preferentially, the possibility that a faulty location can bedetected in a short period of time is raised. Further, in a case wherethe contact is a special auxiliary contact, the influence exerted uponthe relay to which this contact is connected is considered to be smalland the need to investigate this contact preferentially is considered tobe less in comparison with the actual input contact.

Rule 3 states that "If the form of the connection of the contact(Feature 3) is serial (A) and the number of remaining contacts necessaryfor the relay to attain the normal state (ON or OFF state) (Feature 6)is small (NB)" (antecedent), "then the degree of priority of thiscontact is made high (PB)" (consequent).

For example, assume that contacts which are candidates for cause offailure (NG) are contacts 04, 05, 06, 08 and 09 in FIGS. 17a and 17b.All of these contacts fall under a series connection (A). However, withregard to the number of remaining contacts necessary for the relay toattain the normal state, the smallest is one in case of contact 09.According to Rule 3, therefore, contact 09 is given the highest degreeof priority.

Rule 4 states that "If the nature of the contact (Feature 1) is that itis an internal auxiliary contact (N) and the position of the contact inthe ladder circuit (Feature 2) is far from the bus-line R (PB)"(antecedent), "then the degree of priority of this contact is made low(NB)" (consequent).

In the ladder circuit, generally an unimportant contact is placed farfrom the bus-line R. Moreover, in case of an internal auxiliary contact,it is necessary to retrieve the relay that corresponds to this contact.Accordingly, the degree of priority of this contact declines.

Rule 5 states that "If the form of the connection of the contact(Feature 3) is parallel (O) and the number of rungs to the actual inputcontact influencing this contact (Feature 5) is neither large nor smallbut medium (ZR)" (antecedent), "then the degree of priority of thiscontact is made somewhat low (NS)" (consequent).

In a case where a contact is connected in parallel with another contact,there is a possibility that the first-mentioned contact is not the causeof failure but that the other contact connected in parallel therewith isthe cause of the failure. Further, if the number of rungs to the actualinput contact is a medium value, the degree of priority is loweredsomewhat since some time is required to retrieve the actual inputcontact.

Rule 6 states that "If the type of the contact (Feature 4) is the bcontact (b) and the number of remaining contacts necessary for the relayto attain the normal state (ON or OFF state) (Feature 6) is large (PB)"(antecedent), "then the degree of priority of this contact is made low(NB)" (consequent).

The reason for this is that generally the influence exerted upon therelay to which a contact is connected is smaller for the b contact thanfor the a contact. Further, if the number of remaining contacts for therelay to attain the normal state is large, the possibility that anothercontact is causing the failure is high and time is required to retrievean actual input contact for which the possibility of failure is high.

Rule 7 states that "If the number of rungs to an actual input contact(Feature 5) is large (PB) and the number of remaining contacts necessaryfor the relay to attain the normal state (ON or OFF state) (Feature 6)is medium (ZR)" (antecedent), "then the degree of priority of thiscontact is made somewhat low (NS)" (consequent).

The reason for this is that if the number of rungs traversed to reachthe actual input contact is large, time is required to reach the actualinput contact for which the possibility of failure is high. In addition,if the number of remaining contacts for the relay connected to thiscontact (Feature 6) to attain the normal state is medium, not that muchtime is needed to retrieve the actual input contact for which thepossibility of failure is high.

Rule 8 states that "If the position of the contact in the ladder circuit(Feature 2) is near the bus-line R (NB) and the number of rungs to theactual input contact (Feature 5) is small (NB)" (antecedent), "then thedegree of priority of this contact is made somewhat high (PS)"(consequent).

The reason for this is that the more important the contact, the closerthe contact is placed to the bus-line R in the ladder circuit. Inaddition, if the number of rungs to the actual input contact is small,not that much time is needed to retrieve the actual input contact forwhich the possibility of failure is high.

The degrees of membership of the antecedents of these rules are obtainedby the membership functions of Features 1 through 6 shown in FIGS. 15athrough 15f. The degrees of membership of the consequents are obtainedwith regard to each of PB to NB in FIG. 16b on the basis of the degreesof membership of the antecedents. The degree of priority of a contact isobtained as the weighted mean value of the membership function of FIG.16b.

By way of example, if it is assumed that the values of Features 1through 6 of contact 09 are as shown in FIG. 17b, then the degree ofpriority of contact 09 is obtained in the manner described below.

FIG. 18a shows the result of obtaining the degrees of membership ofantecedents and consequents in a case where Rules 1 through 8 areapplied to contact 09.

Since the value of Feature 6 of contact 09 is 1 (FIG. 17b), the degreeof membership NB of Feature 6 is equal to 1 in accordance with themembership function of FIG. 15f. Further, since contact 09 is an acontact, the degree of membership of Feature 4 is 1. Accordingly, thedegree of membership of the antecedent of Rule 1 becomes 1 by taking theAND between the degree of membership of Feature 6 and the degree ofmembership of Feature 4. As a result, the degree of membership for whichthe degree of priority in the consequent is PB is 1.

Similarly, the degree of membership of the antecedent of Rule 2 is 0 andthe degree of membership for which the degree of priority in theconsequent is PB is 0. The degree of membership of the antecedent ofRule 3 is 1 and the degree of membership for which the degree ofpriority in the consequent is PB is 1. Accordingly, for Rules 1 to 3overall, the degree of membership for which the degree of priority is PBis 1.

The degree of membership of the antecedent of Rule 4 is 0 and the degreeof membership for which the degree of priority in the consequent is NBis 0. The degree of membership of the antecedent of Rule 6 is 0 and thedegree of membership for which the degree of priority in the consequentis NB is 0. Accordingly, the degree of membership for which the degreeof priority is NB is 0.

In accordance with Rules 5 and 7, the degree of membership for which thedegree of priority is NS is 0.

The degree of membership of the antecedent of Rule 8 is 1 and the degreeof membership for which the degree of priority in the consequent is PSis 1.

Accordingly, as shown in FIG. 18b, the degrees of membership for whichthe degrees of priority are NB and NS are 0, and the degrees ofmembership for which the degrees of priority are PS and PB are 1. Thedegree of priority, which is obtained as the weighted mean of thesevalues, is 0.875, where we let 0 represent the degree of membership forwhich the degree of priority is ZR.

As for another example, when the degree of priority of contact 06 isobtained in the same manner, the degree of priority of contact 06 is0.75.

Rules 1 to 8 have been cited as one example of rules in fuzzy reasoning.However, rules other than these may be used if the rules allowappropriate reasoning to be performed. In addition, other rules and theabove-mentioned Rules 1 to 8 may be used in combination.

Of course, rather than performing fuzzy reasoning, it is possible toobtain only Feature 1 with regard to each contact and preferentiallyinvestigate only actual input contacts. Only Feature 2 may be obtainedwith regard to each contact, and investigation can be performedpreferentially starting from contacts at positions closest to thebus-line R.

(3) Processing for detecting faulty actuators

FIG. 19 is a flowchart illustrating the flow of processing through whichthe fault detecting apparatus 1 detects failure of an actuator in thecontrolled system 3.

A user specifies an actuator that is the object of fault detection amongthe actuators in the controlled system 3 and enters information (e.g.,the relay number), which specifies the relay corresponding to thisactuator, into the fault detecting apparatus 1 using the keyboard 14(step 501). All actuators of the controlled system 3 can be made theobject of fault detection.

Further, using the keyboard 14, the user enters a requirement as to thekind of condition that must be established for the designated relay(actuator) to be turned ON or OFF (actuated), as well as what is thenormal state (ON or OFF) that should be attained by the relay if thecondition is established (step 502). An example of the condition is theON or OFF state of a contact. Alternatively, though the details will bedescribed later, the necessary condition can be written in the ladderprogram in advance.

In a case where the ON or OFF state of a contact has been designated asthe condition by the user, and when the controlled system 3 startsoperating, the CPU 11 of the fault detecting apparatus 1 refers to theI/O table in the RAM 23 of the PLC 2 to monitor whether the ON or OFFstate (the operating condition) of the designated contact has beenestablished (step 503).

In a case where the operating condition has been established (YES atstep 503), a timer is started (step 504). The time in the timer also isset by the user in advance.

Next, whether the designated relay is in normal state (has beenactuated) is determined by the CPU 11 (step 505). In a case where thedesignated relay has been actuated (YES at step 505), this means thatthe designated relay (as well as the actuator to which the signal fromthis relay is applied) is operating normally. The CPU 11 repeatsprocessing from step 503 in order to monitor whether actuation ofanother designated relay (actuator) or the next actuation of the samerelay is performed normally or not.

If the designated relay is not operating (NO at step 505), then it isdetermined whether the prescribed period of time set in the timer haselapsed (step 506). If the prescribed time period has not elapsed (NO atstep 506), then it is again determined whether the relay has startedoperation (step 505). If the relay does not start operating even uponelapse of the prescribed time period (YES at step 506), a decision isrendered to the effect that the relay (as well as the actuator to whichthe signal from the relay is applied) is faulty (step 507). The factthat the designated actuator is faulty is displayed on the display unit15 to so inform the user.

FIG. 20 illustrates another example in which actuator failure isdetected. As mentioned above, the necessary condition is written in theladder program to add the actuator fault-detecting function to theladder program.

In the ladder program, an individual ladder circuit C78 including anapplication instruction C78C, a contact 110 and a contact 204 isinserted ahead of address 00078 in FIG. 4. A ladder circuit containingan application instruction is inserted by the user in advance when theuser creates the ladder program.

The actuator designated as an object of investigation is the actuator towhich the relay output from the relay 110 (drill descent) is applied.Assume here that the relay 110 turns ON within a time period of lessthan 45 seconds from the moment the contact 204 turns ON in the normaloperating state.

The application instruction C78C is composed of a command portion (FPD),a timer portion (#0050) and a message portion (DM10).

The content of processing according to the application instruction isdescribed in the command portion. For example, processing is describedto the effect that if the application instruction has attained the ONstate, the timer is started and the message written in the messageportion is issued upon elapse of the time period set in the timer.

The time to be counted by the timer is written in the timer portion.Here "#0050# means 50 seconds.

The message issued from the application instruction is written in themessage portion. The message includes the number of the relay undergoingmonitoring, a message written by the use at will, etc.

The application instruction C78C attains the 0N state to start the timerwhen the contacts 204 and 110 turn ON, and attains the OFF state to stopthe timer when the contact 204 or 110 or both turns OFF.

In a case where the contacts 204 and 110 are in the ON state even if thetime (50 seconds) set in the timer portion elapses from start of thetimer, the application instruction C78C outputs the message that hasbeen stored in the message portion DM10. This message is sent to thefault detecting apparatus 1, where it is displayed on the display unit15.

More specifically, in a case where the relay 110 is OFF and the contacts110 and 204 are ON, the timer of the application instruction C78C isstarted. In the normal state, the relay 110 turns ON within 45 secondsfrom the moment the contact 204 turns on, as mentioned above. Therefore,if the relay 110 turns on within 45 seconds, the contact 110 attains theOFF state, the timer of the application instruction C78C stops and amessage is not issued.

On the other hand, if the relay 110 (actuator) causes a failure and doesnot attain the ON state even if the contact 204 turns ON, the contact110 remains in the ON state and the timer continues running. The messageis issued at elapse of 50 seconds. By including the number of the relayin the message, the user is capable of ascertaining that the relay 110caused the failure.

Thus, whether a designated actuator is operating normally can beverified. If an actuator has failed, which actuator failed can bespecified easily and quickly.

In this embodiment, the application instruction C78C is describedimmediately ahead of the relay 110, which is object of monitoring. Bythus writing the application instruction adjacent the relay undergoingmonitoring, it is unnecessary to designate the relay, which is theobject of monitoring, in the application instruction. Accordingly, atcreation of a ladder program, the relay that is the object of monitoringcan be specified without checking whether designation of the relay iscorrect or not.

It should be noted that the ladder circuit C78 that includes theapplication instruction C78C can be written immediately after the relay110 undergoing monitoring rather than immediately before it. Further,besides the output relay, an internal auxiliary relay, a timer or acounter, etc., can be adopted as the object monitored for detection offailure.

(4) Processing for detecting faulty actuators and detectors

The fault detecting apparatus 1 is capable of detecting failure ofactuators and failure of detectors in concert. That is, the faultdetecting apparatus can function as an overall fault detecting apparatusin which candidates for faulty locations can be detected easily and in ashort period of time by combining both types of processing.

FIG. 21 is a flowchart illustrating the flow of processing through whichthe fault detecting apparatus 1 detects failure of an actuator andfailure of a detector in concert.

The processing from step 601 to step 606 is the same as the processingfrom step 501 to step 506 in FIG. 19.

In a case where a designated relay (actuator) does not perform aprescribed operation even if the prescribed time set in the timerelapses (YES at step 606), candidates for contacts that have possiblyfailed are extracted by the CPU 11 from among the contacts connected tothis actuator, and the extracted contacts are stored in the RAM 13 (step607). The details of processing for extracting and storing the contactsare the same as the details of processing of steps 303 to 315 in FIGS. 5and 6.

The contacts extracted by the CPU 11 and stored in the RAM 13 aredisplayed on the display unit 15 to inform the user (step 608).Processing is then terminated.

Thus, in processing for detecting failure of actuators and detectors,detection of abnormality of an actuator to detection of abnormality ofthe detector that is the cause can be performed collectively through aseries of processing steps.

FIG. 22 is a flowchart showing the flow of processing for detectingfailure of actuators and detectors in a case where an applicationinstruction for performing actuator fault detection is written in aladder program.

As mentioned above, the application instruction sends a message to thefault detecting apparatus 1 in a case where a prescribed relay does notperform a prescribed operation within a period of time set in a timer.The message includes the number of the relay being monitored by theapplication instruction.

Upon receiving the message from the PLC 2 (step 610), the CPU 11retrieves the relay of the ladder program on the basis of the number ofthe relay contained in the message (step 611).

The CPU 11 then determines whether the retrieved relay is an outputrelay (step 612).

In a case where the retrieved relay is an output relay (YES at step612), the contacts connected to this relay are extracted and stored inthe RAM 13 (step 613). Processing for extracting and storing thecontacts is the same as the processing of steps 303 to 315 in FIG. 5 and6.

The results of extracting the contacts are displayed on the display unit15 to inform the user (step 614). Processing is then terminated.

In a case where the retrieved relay is not an output relay (NO at step612), error processing is executed. Examples of relays that are notoutput relays are a retrieved relay that delivers a keep output and aretrieved relay that performs the four arithmetic operations.

An example of error processing is to display the retrieved relay on thedisplay unit to inform the user of the fact that an error has occurred.

An internal auxiliary relay or a timer, counter, etc., can be includedin the relay designated by the user at step 601 in FIG. 21 or in therelay adopted as the object of monitoring by the application instructionin FIG. 20.

(5) Processing for detecting failure of internal auxiliary contacts andspecial auxiliary contacts or programming errors

FIGS. 23 and 24 are flowcharts showing the flow of processing throughwhich the fault detecting apparatus 1 detects failure (abnormality) ofinternal auxiliary contacts and special auxiliary contacts or aprogramming error in a ladder program.

As regards to internal auxiliary contacts and special auxiliarycontacts, there are cases in which a programming error, such asmisnumbering a contact, is made when the user creates the ladderprogram. There are also cases in which the ladder program containsso-called program bugs.

In the same manner as performed in the processing (FIG. 5) for detectingfailure of detectors, information (e.g., relay number) designating arelay and whether the proper state that is to be established at thedesignated relay is the ON or OFF state are entered into the errordetecting apparatus 1 (steps 701,702). The CPU 11 stores the enteredinformation in the RAM 13.

If the designated relay is in the OFF state regardless of the fact thatit is originally intended to be in the ON state (YES at step 703), thenan OFF contact is extracted from among the contacts connected to thedesignated relay and this contact is stored in the RAM 13 (step 704). Ifthe designated relay is in the ON state regardless of the fact that itis originally intended to be in the OFF state (NO at step 703), then anON contact is extracted from among the contacts connected to thedesignated relay and this contact is stored in the RAM 13 (step 705).The details of the processing of step 704 is the same as in FIGS. 7 and8, and the details of processing of step 705 is the same as in FIGS. 9and 10.

All of the contacts extracted and stored in the RAM 13 are displayed onthe display unit 15 to inform the user (step 706).

In a case where a plurality of contacts are displayed on the displayunit 15 (YES at step 707), the user selects one contact from among thedisplayed contacts and the number of this contact is entered into thefault detecting apparatus 1 using the keyboard 14 (step 708). If onecontact is displayed (NO at step 707), then this contact is selectedautomatically by the CPU 11.

The fact that the selected contact has been selected is written in theRAM 13 by the CPU 11 (e.g., a flag indicating that the selected contacthas been selected is set) so that selection of the same contact will notoccur in subsequent processing (step 709).

Next, it is determined whether the selected contact is an actual inputcontact (step 710). In a case where the selected contact is an actualinput contact (YES at step 710), the fact that this contact is an actualinput contact and not an internal auxiliary contact or special auxiliarycontact is displayed on the display unit 15 to so inform the user (step711).

In a case where the selected contact is not an actual input contact,i.e., in a case where the selected contact is an internal auxiliarycontact or special auxiliary contact (NO at step 710), the fact thatthis contact is a candidate for cause of failure is displayed on thedisplay unit 15 to so inform the user (step 714).

In a case where the selected contact is an internal auxiliary contact(YES at step 715), whether the output relay or internal auxiliary relaythat controls the state of this contact is to be retrieved or not isentered by the user (step 716).

In case of retrieval (YES at step 716), the relay corresponding to thiscontact is retrieved (step 717) and processing from step 703 is repeatedin order to extract the contacts connected to the retrieved relay.

In a case where the contact selected at step 715 is not an internalauxiliary contact, or in a case where retrieval is not carried out atstep 716, the contacts that have been stored in the RAM 16 areinvestigated to see if there is a contact that has not been selected(step 712).

If an unselected contact resides in the RAM 13 (YES at step 712), thenwhether investigation regarding the unselected contact is to continue ornot is entered by the user (step 713). If investigation is to continue,(YES at step 713), then processing is repeated from step 707; otherwise(NO at step 713), processing ends. Processing ends also in a case whereunselected contacts do not remain in the RAM 13 (NO at step 712).

Processing from step 712 onward is executed even after the processing ofstep 711.

Thus, contacts that are candidates for failure of programming error canbe extracted automatically with regard to internal auxiliary contactsand special auxiliary contacts. By displaying a candidate contact, theuser can readily verify the abnormality or programming error pertainingto the contact.

In the processing for detecting internal auxiliary contacts and specialauxiliary contacts as well, the selection of contacts at step 708 can beperformed automatically in the order of degree of priority by obtainingthe degree of priority through the above-described inferentialprocessing with regard to each contact extracted. Further, rather thanperforming inferential processing, it is possible to obtain onlyfeatures with regard to each contact and preferentially investigate onlycontacts (e.g., internal auxiliary contacts) having a certain feature.

(6) Example of application

As an example of application of processing for detecting detectors or ofprocessing for detecting internal auxiliary contacts and specialauxiliary contacts, a contact other than an internal auxiliary contactis extracted and stored. Contacts other than internal auxiliary contactsinclude actual input contacts, special auxiliary contacts and theabove-mentioned link relays.

FIGS. 25 and 26 are flowcharts illustrating the flow of processing ofthis example of application.

The processing of steps 801 to 809 is the same as the processing ofsteps 301 to 309 in FIG. 5.

It is determined at step 810 whether a selected contact is an internalauxiliary contact. The determination as to whether a contact is aninternal auxiliary contact can be performed by checking to see whether arelay having the same number as the contact is present in the ladderprogram, as set forth earlier. If a relay having the same number as thecontact is present in the program, then this contact is an internalauxiliary contact.

In a case where the selected contact is an internal auxiliary contact(YES at step 810), the relay having the same number as this contact (therelay that controls the state of this contact) is retrieved (step 813)and processing is repeated from step 803 in order to investigate thecontacts connected to the relay retrieved.

In a case where the selected contact is not an internal auxiliarycontact (NO at step 810), this contact is stored in the RAM 13 as acandidate for cause of failure. It is then determined whether a contactnot selected resides in the RAM 13 (step 812). If such a contact ispresent in the RAM, processing is repeated from step 807; otherwise,processing is terminated.

The selection of contacts at step 808 can be performed automatically inthe order of degree of priority by obtaining the degree of prioritythrough the above-described inferential processing with regard to eachcontact extracted. Further, rather than performing inferentialprocessing, it is possible to obtain only features with regard to eachcontact and preferentially investigate only contacts (e.g., internalauxiliary contacts) having a certain feature.

Thus, it is also possible to detect abnormalities in special auxiliarycontacts and link relays in addition to actual input contacts.

What is claimed is:
 1. An apparatus for detecting a fault in a detectorthrough a control apparatus, which controls a controlled systemincluding one or two or more detectors and one or two or more actuators,having an input-signal memory for storing the state of an input signalfrom said detector, an auxiliary input-signal memory for storing thestate of an input signal provided by an auxiliary-signal generator, anarithmetic-logic unit for generating an output signal to be applied tosaid actuator in accordance with predetermined logic in conformity withthe states of the input signals stored in said input-signal memory, andauxiliary input-signal memory and an output-signal memory for storingthe state of the output signal generated by said arithmetic-logicunit;wherein when there is an actuator not operating normally in saidcontrolled system, a dector that is possibly faulty in said controlledsystem is detected through said control apparatus, said apparatus fordetecting the fault comprising:a designation input unit for designatingan identification code of an abnormal output signal corresponding to theactuator not operating normally; an input-signal extractor forextracting an input signal that has influenced a logical operation,performed by said arithmetic-logic unit, which gave rise to the abnormaloutput signal designated by said designation input unit; a determiningunit for determining whether the input signal extracted by saidinput-signal extractor is the signal that has been stored in saidinput-signal memory; and a storage device which, if result of thedetermination by said determining unit is that the extracted inputsignal is the signal that has been stored in the input-signal memory,stores an identification code of this input signal.
 2. The apparatus fordetecting a fault in a detector according to claim 1, further comprisinga display unit for displaying the identification code of the inputsignal that has been stored in said storage device.
 3. The apparatus fordetecting a fault in a detector according to claim 1, wherein in a casewhere the result of determination by said determining unit is that theextracted input signal is the signal that has been stored in theauxiliary input-signal memory and that it is controlled by the state ofthe output signal of the control apparatus, said input-signal extractorrepeats extraction of the input signal that has influenced the logicaloperation, performed by said arithmetic-logic unit, which gave rise tothe abnormal output signal that controls the state of said extractedinput signal.
 4. The apparatus for detecting a fault in a detectoraccording to claim 3, further comprising a degree-of-priority calculatorwhich, in a case where a plurality of input signals have been extracted,calculates a degree of priority of each input signal;said input-signalextractor ending extraction processing when the number of input signalsstored in said storage device becomes larger than a predeterminedprescribed number or when there are no longer any input signals to beextracted; and in a case where extraction processing by saidinput-signal extractor has not ended, said determining unit performs thedetermination processing in regular order starting from the input signalfor which the degree of priority is calculated to be high by saiddegree-of-priority calculator when a plurality of input signals havebeen extracted, and performs the determination processing with regard toone input signal when one input signal has been extracted.
 5. Theapparatus for detecting a fault in a detector according to claim 4,wherein said degree-of-priority calculator calculates a degree ofpriority by obtaining features of each extracted input signal andexecuting fuzzy reasoning based upon these features.
 6. An apparatus fordetecting a fault in a detector according to claim 1, wherein saidcontrol apparatus is constituted by a programmable logic controller;thestate of the input signal corresponds to the state of a contact of theprogrammable logic controller; and the state of said output signalcorresponds to the state of a relay of the programmable logiccontroller.
 7. The apparatus for detecting a fault in a detectoraccording to claim 1, wherein said apparatus for detecting a fault in adetector is implemented by a computer system.
 8. An apparatus fordetecting a fault in an actuator through a control apparatus, whichcontrols a controlled system including one or two or more detectors andone or two or more actuators, having an input-signal memory for storingthe state of aninput signal from said detector, an auxiliaryinput-signal memory means for storing the state of an input signalprovided by an auxiliary-signal generator, an arithmetic-logic unit forgenerating an output signal to be applied to said actuator in accordancewith predetermined logic in conformity with the states of the inputsignals stored in said input-signal memory and auxiliary input-signalmemory, and an output-signal memory for storing the state of the outputsignal generated by said arithmetic-logic unit;wherein when there is anactuator not operating normally in said controlled system, the actuatoris detected through said control apparatus, said apparatus for detectingthe fault comprising:a first determining unit for determining whether aprescribed condition for generation of an output signal to be applied tothe actuator has been established; a second determining unit fordetermining whether the state of said output signal is normal; and athird determining unit which, in a case where it has been determined bysaid first determining unit and second determining unit that the stateof the output signal has not become normal even upon elaspe of aprescribed time from establishment of said prescribed condition,determines that the actuator to which this output signal is to beapplied is faulty.
 9. An apparatus for detecting a fault in an actuatoraccording to claim 8, wherein said control apparatus is constituted by aprogrammable logic controller;the state of said input signal correspondsto the state of a contact of the programmable logic controller; and thestate of said output signal corresponds to the state of a relay of theprogrammable logic controller.
 10. An apparatus for detecting a fault inan actuator according to claim 9, wherein said first determining unit,second determining unit and third determining unit are provided in theprogrammable logic controller.
 11. The apparatus for detecting a faultin an actuator according to claim 8, wherein said apparatus fordetecting a fault in an actuator is implemented by a computer system.12. An apparatus for detecting a fault in an actuator and a detectorthrough a control apparatus, which controls a controlled systemincluding one or two or more detectors and one or two or more actuators,having an input-signal memory for storing the state of an input signalfrom said detector, an auxiliary input-signal memory for storing thestate of an input signal provided by an auxiliary-signal generator, anarithmetic-logic unit for generating an output signal to be applied tosaid actuator in accordance with predetermined logic in conformity withthe states of the input signals stored in said input-signal memory andauxiliary input-signal memory, and an output-signal memory for storingthe state of the output signal generated by said arithmetic-logicunit;wherein when there is an actuator not operating normally in saidcontrolled system, the actuator is detected through said controlapparatus and a detector that is possibly faulty in said controlledsystem and a cause of failure of the actuator is detected through saidcontrol apparatus, said apparatus for detecting the fault comprising:afirst determining unit for determining whether a prescribed conditionfor generation of an output signal to be aplied to the actuator has beenestablished; a second determining unit for determining whether the stateof said output signal is normal; a third determining unit which, in acase where it has been determined by said first determining unit andsecond determining unit that the state of the output signal has notbecome normal even upon elaspe of a prescribed time from establishmentof said prescribed condition, determines that the actuator to which thisoutput signal is to be applied is faulty; an input-signal extractor forextracting an input signal that has influenced a logical operation,performed by said arithmetic-logic means, which gave rise to theabnormal output signal determined by said third determining unit; afourth determining unit for determining whether the input signalextracted by said input-signal extractor is the signal that has beenstored in said input-signal memory; and a storage device which, ifresult of the determination by said fourth determining unit is that theextracted input signal is the signal that has been stored in theinput-signal memory, stores an identification code of this input signal.13. The apparatus for detecting a fault in an actuator and a detectoraccording to claim 12, further comprising a display unit for displayingthe identification code of the input signal that has been stored in saidstorage device.
 14. The apparatus for detecting a fault in an actuatorand a detector according to claim 12, wherein in a case where the resultof determination by said fourth determining unit is that the extractedinput signal is the signal that has been stored in the auxiliaryinput-signal memory and that it is controlled by the state of the outputsignal of the control apparatus, said input-signal extractor repeatsextraction of the input signal that has influenced the logicaloperation, performed by said arithmetic-logic unit, which gave rise tothe abnormal output signal that controls the state of said extractedinput signal.
 15. The apparatus for detecting a fault in an actuator anda detector according to claim 14, further comprising adegree-of-priority calculator which, in a case where a plurality ofinput signals have been extracted, calculates a degree of priority ofeach input signal;said input-signal extractor ending extractionprocessing when the number of input signals stored in said storagedevice becomes larger than a predetermined prescribed number or whenthere are no longer any input signals to be extracted; and in a casewhere extraction processing by said input-signal extractor has notended, said fourth determining unit performs the determinationprocessing in regular order starting from the input signal for which thedegree of priority is calculated to be high by said degree-of-prioritycalculator when a plurality of input signals have been extracted, andperforms the determination processing with regard to one input signalwhen one input signal has been extracted.
 16. The apparatus fordetecting a fault in an actuator and a detector according to claim 15,wherein said degree-of-priority calculator calculates a degree ofpriority by obtaining features of each extracted input signal andexecuting fuzzy reasoning based upon these features.
 17. The apparatusfor detecting a fault in an actuator and a detector according to claim12, wherein said control apparatus is a programmable logiccontroller;the state of said input signal corresponds to the state of acontact of the programmable logic controller; and the state of saidoutput signal corresponds to the state of a relay of the programmablelogic controller.
 18. The apparatus for detecting a fault in an actuatorand a detector according to claim 17, wherein said first determiningunit, said second determining unit and third determining unit areprovided in the programmable logic controller.
 19. The apparatus fordetecting a fault in an actuator and a detector according to claim 12,wherein said apparatus for detecting a fault in an actuator and adetector is implemented by a computer system.
 20. An apparatus fordetecting a fault in an input signal; wherein a control apparatus, whichcontrols a controlled system including one or two or more detectors andone or two or more actuators, has an input-signal memory for storing thestate of an input signal from said detector, an auxiliary input-signalmemory for storing the state of an input signal provided by anauxiliary-signal generator, an arithmetic-logic unit for generating anoutput signal to be applied to said actuator in accordance withpredetermined logic in conformity with the states of the input signalsstored in said input-signal memory and auxiliary input-signal memory,and an output-signal memory for storing the state of the output signalgenerated by said arithmetic-logic unit; andwherein when there is anactuator not operating normally in said controlled system, an inputsignal that is possibly abnormal is detected, said apparatus fordetecting the fault comprising:a designation input unit for designatingan identification code of an abnormal output signal corresponding to theactuator not operating normally; an input-signal extractor forextracting an input signal that has influenced a logical operation,performed by the arithmetic-logic unit, which gave rise to the abnormaloutput signal designated by said designation input unit; and a storagedevice for storing an identification code of the input signal extractedby said input-signal extractor.
 21. The apparatus for detecting a faultin an input signal according to claim 20, further comprising a displayunit for displaying the identification code of the input signal that hasbeen stored in said storage device.
 22. The apparatus for detecting afault in an input signal according to claim 20, wherein in a case wheresaid extracted input signal is the signal that has been stored in theauxiliary input-signal memory and is controlled by the state of theoutput signal of the control apparatus, said input-signal extractorrepeats extraction of the input signal that has influenced the logicaloperation, performed by said arithmetic-logic unit, which gave rise tothe abnormal output signal that controls the state of said extractedinput signal.
 23. The apparatus for detecting a fault in an input signalaccording to claim 22, further comprising a degree-of-prioritycalculator which, in a case where a plurality of input signals have beenextracted, is for calculating a degree of priority of each inputsignal;said input-signal extractor ending extraction processing when thenumber of input signals stored in said storage device becomes largerthan a predetermined prescribed number or when there are no longer anyinput signals to be extracted.
 24. The apparatus for detecting a faultin an input signal according to claim 23, wherein saiddegree-of-priority calculator calculates a degree of priority byobtaining features of each extracted input signal and executing fuzzyreasoning based upon these features.
 25. The apparatus for detecting afault in an input signal according to claim 20, wherein said apparatusfor detecting a fault in an input signal is constituted by aprogrammable logic controller;the state of the input signal correspondsto the state of a contact of the programmable logic controller; and thestate of said output signal corresponds to the state of a relay of theprogrammable logic controller.
 26. The apparatus for detecting a faultin an input signal according to claim 20, wherein said apparatus fordetecting a fault in an input signal is implemented by a computersystem.
 27. A method of detecting a fault in a detector through acontrol apparatus, which controls a controlled system including one ortwo or more detectors and one or two or more actuators, having aninput-signal memory for storing the state of an input signal from saiddetector, an auxiliary input-signal memory for storing the state of aninput signal provided by an auxiliary-signal generator, anarithmetic-logic unit for generating an output signal to be applied tosaid actuator in accordance with predetermined logic in conformity withthe states of the input signals stored in said input-signal memory andauxiliary input-signal memory, and an output-signal memory for storingthe state of the output signal generated by said arithmetic-logicunit;wherein when there is an actuator not operating normally in saidcontrolled system, a detector that is possibly faulty in said controlledsystem is detected through said control apparatus, said method ofdetecting the fault comprising the steps of:extracting, on the basis ofa designated abnormal output signal corresponding to the actuator notoperating normally, an input signal that has influenced a logicaloperation, performed by said arithmetic-logic unit, which gave rise tothis abnormal output signal; determining whether said extracted inputsignal is the signal that has been stored in said input-signal memory;and if result of said determination is that the extracted input signalis the signal that has been stored in the input-signal memory, storingan identification code of this input signal in a storage device.
 28. Themethod of detecting a fault in a detector according to claim 27, furthercomprising a step of displaying the identification code of the inputsignal that has been stored in said storage device.
 29. The method ofdetecting a fault in a detector according to claim 27, wherein in a casewhere the result of said determination is that the extracted inputsignal is the signal that has been stored in the auxiliary input-signalmemory and that it is controlled by the state of the output signal ofthe control apparatus, extraction of the input signal that hasinfluenced the logical operation, performed by said arithmetic-logicunit, which gave rise to the abnormal output signal that controls thestate of said extracted input signal is repeated.
 30. The method ofdetecting a fault in a detector according to claim 29, furthercomprising steps of:calculating a degree of priority of each inputsignal in a case where a plurality of input signals have been extracted;ending extraction of said input signal when the number of input signalsstored in said storage device becomes larger than a predeterminedprescribed number or when there are no longer any input signals to beextracted; and in a case where extraction has not ended, performing saiddetermination in regular order starting from the input signal for whichthe degree of priority is calculated to be high when a plurality ofinput signals have been extracted, and performing said determinationwith regard to one input signal when one input signal has beenextracted.
 31. The method of detecting a fault in a detector accordingto claim 30, further comprising a step of calculating said degree ofpriority by obtaining features of each extracted input signal andexecuting fuzzy reasoning based upon these features.
 32. The method ofdetecting a fault in a detector according to claim 27, wherein saidcontrol apparatus is constituted by a programmable logic controller;thestate of said input signal corresponds to the state of a contact of theprogrammable logic controller; and the state of the said output signalcorresponds to the state of a relay of the programmable logiccontroller.
 33. A method of detecting a fault in an actuator through acontrol apparatus, which controls a controlled system including one ortwo or more detectors and one or two or more actuators, having aninput-signal memory for storing the state of an input signal from saiddetector, an auxiliary input-signal memory for storing the state of aninput signal provided by an auxiliary-signal generator, anarithmetic-logic unit for generating an output signal to be applied tosaid actuator in accordance with predetermined logic in conformity withthe states of the input signals stored in said input-signal memory andauxiliary input-signal memory, and an output-signal memory for storingthe state of the output signal generated by said arithmetic-logicunit;wherein when there is an actuator not operating normally in saidcontrolled system, the actuator is detected through the controlapparatus, the method of detecting the fault comprising the stepsof:performing a first determination as to whether a prescribed conditionfor generation of an output signal to be applied to the actuator hasbeen established; performing a second determination as to whether thestate of said output signal is normal; and in a case where it has beendetermined that the state of the output signal has not become normaleven upon elapse of a prescribed time from establishment of saidprescribed condition, performing a third determination that the actuatorto which this output signal is to be applied is faulty.
 34. The methodof detecting a fault in an acutator according to claim 33, wherein saidcontrol apparatus is constituted by a programmable logic controller;thestate of said input signal corresponds to the state of a contact of theprogrammable logic controller; and the state of said output signalcorresponds to the state of a relay of the programmable logiccontroller.
 35. The method of detecting a fault in an actuator accordingto claim 34, wherein the programmable logic controller performs saidfirst, second and third determinations.
 36. A method of detecting afault in an actuator and a detector through a control apparatus, whichcontrols a controlled system including one or two or more detectors andone or two or more actuators, having an input-signal memory for storingthe state of an input signal from said detector, an auxiliaryinput-signal memory for storing the state of an input signal provided byan auxiliary-signal generator, an arithmetic-logic unit for generatingan output signal to be applied to said actuator in accordance withpredetermined logic in conformity with the states of the input signalsstored in said input-signal memory and auxiliary input-signal memory,and an output-signal memory for storing the state of the output signalgenerated by said arithmetic-logic unit;wherein when there is anactuator not operating normally in said controlled system, the actuatoris detected through the control apparatus and a detector that ispossibly faulty in the controlled system and a cause of failure of theactuator is detected through said control apparatus, the method ofdetecting the fault comprising the steps of:performing a firstdetermination as to whether a prescribed condition for generation of anoutput signal to be applied to the actuator has been established;performing a second determination as to whether the state of said outputsignal is normal; in a case where it has been determined that the stateof the output signal has not become normal even upon elapse of aprescribed time from establishment of said prescribed condition,performing a third determination that the actuator to which this outputsignal is to be applied is faulty; extracting an input signal that hasinfluenced a logical operation, performed by said arithmetic-logic unit,which gave rise to the abnormal output signal for which said fault hasbeen determined; performing a fourth determination as to whether saidextracted input signal is the signal that has been stored in saidinput-signal memory; and if result of said fourth determination is thatthe extracted input signal is the signal that has been stored in theinput-signal memory, storing an identification code of this inputsignal.
 37. The method of detecting a fault in an actuator and adetector according to claim 36, further comprising a step of displayingthe identification code of the input signal that has been stored in saidstorage device.
 38. The method of detecting a fault in an actuator and adetector according to claim 36, wherein in a case where the result ofsaid fourth determination is that the extracted input signal is thesignal that has been stored in the auxiliary input-signal memory andthat it is controlled by the state of the output signal of the controlapparatus, extraction of the input signal that has influenced thelogical operation, performed by said arithmetic-logic unit, which gaverise to the abnormal output signal that controls the state of saidextracted input signal is repeated.
 39. The method of detecting a faultin an actuator and a detector according to claim 38, further comprisingsteps ofcalculating a degree of priority of each input signal in a easewhere a plurality of input signals have been extracted; endingextraction of said input signal when the number of input signals storedin said storage device becomes larger than a predetermined prescribednumber or when there are no longer any input signals to be extracted;and in a case where extraction has not ended, performing thedetermination, as to whether the extracted input signal has been storedin said input-signal memory means, in regular order starting from theinput signal for which the degree of priority is calculated to be highwhen a plurality of input signals have been extracted, and performingthe determination, as to whether the extracted input signal has beenstored in said input-signal memory when one input signal has beenextracted.
 40. The method of detecting a fault in an actuator and adetector according to claim 39, further comprising a step of calculatingsaid degree of priority by obtaining features of each extracted inputsignal and executing fuzzy reasoning based upon these features.
 41. Themethod of detecting a fault in an actuator and a detector according toclaim 36, wherein said control apparatus is constituted by aprogrammable logic controller;the state of said input signal correspondsto the state of a contact of the programmable logic controller; and thestate of said output signal corresponds to the state of a relay of theprogrammable logic controller.
 42. The method of detecting a fault in anactuator and a detector according to claim 41, wherein the programmablelogic controller performs said first, second and third determinations.43. A method of detecting a fault in an input signal; wherein a controlapparatus, which controls a controlled system including one or two ormore detectors and one or two or more actuators, having an input-signalmemory for storing the state of an input signal from said detector, anauxiliary input-signal memory for storing the state of an input signalprovided by an auxiliary-signal generator, an arithmetic-logic unit forgenerating an output signal to be applied to said actuator in accordancewith predetermined logic in conformity with the states of the inputsignals store in said input-signal memory and auxiliary input-signalmemory, and an output-signal memory for storing the state of the outputsignal generated by said arithmetic-logic unit; andwherein when there isan actuator not operating normally in said controlled system, an inputsignal that is possibly abnormal is detected, the method of detectingthe fault comprising the steps of:extracting, on the basis of adesignated abnormal output signal corresponding to the actuator notoperating normally, an input signal that has influenced a logicaloperation, performed by said arithmetic-logic unit, which gave rise tothis abnormal output signal; and storing an identification code of saidextracted input signal in a storage device.
 44. The method of detectinga fault in an input signal according to claim 43, further comprising astep of displaying the identification code of the input signal that hasbeen stored in said storage device.
 45. A control apparatus, which isequipped with a function for detecting a fault in a detector, forcontrolling a controlled system including one or two or more detectorsand one or two or more actuators, said control apparatus comprising:anarithmetic-logic unit for generating an output signal to be applied tosaid actuator in accordance with predetermined logic in conformity withthe state of an input signal from said detector and the state of anauxiliary input signal; a designation input unit which, when there is anactuator not operating normally in said controlled system, designates anidentification code of an abnormal output signal corresponding to theactuator not operating normally; an input-signal extractor forextracting an input signal that has influenced a logical operation,performed by said arithmetic-logic unit, which gave rise to the abnormaloutput signal designated by said designation input unit; and a storagedevice which, if the input signal extracted by said input-signalextractor is from said detector, stores an identification code of thisinput signal.
 46. The control apparatus equipped with a function fordetecting a fault in a detector according to claim 45, wherein in a casewhere the extracted input signal is an auxiliary input signal and iscontrolled by the state of the output signal of the control apparatus,said input-signal extractor repeats extraction of the input signal thathas influenced the logical operation, performed by said arithmetic-logicunit, which gave rise to the abnormal output signal that controls thestate of said extracted input signal.
 47. The control apparatus equippedwith a function for detecting a fault in a detector according to claim46, further comprising a degree-of-priority calculating means which, ina case where a plurality of input signals have been extracted,calculates a degree of priority of each input signal;said input-signalextractor ending extraction processing when the number of input signalsstored in said storage device becomes larger than a predeterminedprescribed number or when there are no longer any input signals to beextracted; wherein when a plurality of input signals have beenextracted, it is determined whether the input signals are from thedetector in regular order starting from the input signal for which thedegree of priority is calculated to be high by said degree-of-prioritycalculating means; when one input signal has been extracted, it isdetermined whether this input signal is from the detector; and if theextracted input signal is from the detector, said storage device storesan identification code of this input signal.
 48. The control apparatusequipped with a function for detecting a fault in a detector accordingto claim 47, wherein said degree-of-priority calculating meanscalculates degree of priority by obtaining features of each extractedinput signal and executing fuzzy reasoning based upon these features.49. The control apparatus equipped with a function for detecting a faultin a detector according to claim 45, wherein said control apparatus isimplemented by a programmable logic controller;the state of said inputsignal corresponds to the state of a contact of the programmable logiccontroller; and the state of said output signal corresponds to the stateof a relay of the programmable logic controller.
 50. The controlapparatus equipped with a function for detecting a fault in a detectoraccording to claim 45, wherein said control apparatus is implemented bya computer system;the state of said output signal corresponds to thestate of a relay of the programmable logic controller.
 51. A controlapparatus, which is equipped with a function for detecting a fault in anactuator and a detector, for controlling a controlled system includingone or two or more detectors and one or two or more actuators, saidcontrol apparatus comprising:an arithmetic-logic unit for generating anoutput signal to be applied to said actuator in accordance withpredetermined logic in conformity with the state of an input signal fromsaid detector and the state of an auxiliary input signal; a determiningunit which, when there is an actuator not operating normally in saidcontrolled system, determines that the actuator to which the outputsignal is to be applied is faulty in a case where the state of theoutput signal has not become normal even upon elapse of a prescribedtime from establishment of a condition for generation of an outputsignal to be applied to the actuator; an input-signal extractor forextracting an input signal that has influenced a logical operation,performed by said arithmetic-logic unit, which gave rise to an abnormaloutput signal determined by said determining unit; and a storage devicewhich, if the input signal extracted by said input-signal extractor isfrom said detector, stores an identification code of this input signal.52. The control apparatus equipped with a function for detecting a faultin an actuator and a detector according to claim 51, wherein in a casewhere the extracted input signal is an auxiliary input signal and iscontrolled by the state of the output signal of the control apparatus,said input-signal extractor repeats extraction of the input signal thathas influenced the logical operation, performed by said arithmetic-logicunit, which gave rise to the abnormal output signal that controls thestate of said extracted input signal.
 53. The control apparatus equippedwith a function for detecting a fault in an actuator and a detectoraccording to claim 52, further comprising a degree-of-prioritycalculating means which, in a case where a plurality of input signalshave been extracted, calculates a degree of priority of each inputsignal;said input-signal extractor ending extraction processing when thenumber of input signals stored in said storage device becomes largerthan a predetermined prescribed number or when there are no longer anyinput signals to be extracted; wherein when a plurality of input signalshave been extracted, it is determined whether the input signals are fromthe detector in regular order starting from the input signal for whichthe degree of priority is calculated to be high by saiddegree-of-priority calculating means; when one input signal has beenextracted, it is determined whether this input signal is from thedetector; and if the extracted input signal is from the detector, saidstorage device stores an identification code of this input signal. 54.The control apparatus equipped with a function for detecting a fault inan actuator and a detector according to claim 53, wherein saiddegree-of-priority calculating means calculates degree of priority byobtaining features of each extracted input signal and executing fuzzyreasoning based upon these features.
 55. The control apparatus equippedwith a function for detecting a fault in an actuator and a detectoraccording to claim 51, wherein said control apparatus is constituted bya programmable logic controller;the state of said input signalcorresponds to the state of a contact of the programmable logiccontroller; and the state of said output signal corresponds to the stateof a relay of the programmable logic controller.
 56. The controlapparatus equipped with a function for detecting a fault in an actuatorand a detector according to claim 51, wherein said control apparatus isimplemented by a computer system.
 57. A control apparatus, which isequipped with a function for detecting a fault in an input signal, forcontrolling a controlled system including one or two or more detectorsand one or two or more actuators, said control apparatus comprising:anarithmetic-logic unit for generating an output signal to be applied tosaid actuator in accordance with predetermined logic in conformity withthe state of an input signal from said detector and the state of anauxiliary input signal; a designation input unit which, when there is anactuator not operating normally in said controlled system, designates anidentification code of an abnormal output signal corresponding to theactuator not operating normally; an input-signal extractor forextracting an input signal that has influenced a logical operation,performed by said arithmetic-logic unit, which gave rise to the abnormaloutput signal designated by said designation input unit; and a storagedevice for storing an identification code of the input signal extractedby said input-signal extractor.
 58. The control apparatus equipped witha function for detecting a fault in an input signal according to claim57, wherein in a case where the extracted input signal is an auxiliaryinput signal and is controlled by the state of the output signal of thecontrol apparatus, said input-signal extractor repeats extraction of theinput signal that has influenced the logical operation, performed bysaid arithmetic-logic unit, which gave rise to the abnormal outputsignal that controls the state of said extracted input signal.
 59. Thecontrol apparatus equipped with a function for detecting a fault in aninput signal according to claim 58, further comprising adegree-of-priority calculating means which, in a case where a pluralityof input signals have been extracted, calculates a degree of priority ofeach input signal;said input-signal extractor ending extractionprocessing when the number of input signals stored in said storagedevice becomes larger than a predetermined prescribed number or whenthere are no longer any input signals to be extracted.
 60. The controlapparatus equipped with a function for detecting a fault in an inputsignal according to claim 59, wherein said degree-of-prioritycalculating means calculates degree of priority by obtaining features ofeach extracted input signal and executing fuzzy reasoning based uponthese features.
 61. The control apparatus equipped with a function fordetecting a fault in a detector according to claim 57, wherein saidcontrol apparatus is constituted by a programmable logic controller;thestate of said input signal corresponds to the state of a contact of theprogrammable logic controller; and the state of said output signalcorresponds to the state of a relay of the programmable logiccontroller.
 62. The control apparatus equipped with a function fordetecting a fault in an input signal according to claim 57, wherein saidcontrol apparatus is implemented by a computer system.
 63. A controlmethod for detecting a fault in a detector, said control methodcontrolling a controlled system including one or two or more detectorsand one or two or more actuators, said control method comprising thesteps of:generating an output signal to be applied to said actuator inaccordance with predetermined logic in conformity with the state of anauxiliary input signal; when there is an actuator not operating normallyin said controlled system, extracting, on the basis of a designatedabnormal output signal corresponding to the actuator not operatingnormally, an input signal that has influenced said logical operation,which gave rise to this abnormal output signal; and in a case whets saidextracted input signal is from said detector, storing an identificationcode of this input signal in a storage device.
 64. A control method fordetecting a fault in an actuator and a detector, said control methodcontrolling a controlled system including one or two or more detectorsand one or two or more actuators, said control method comprising thesteps of:generating an output signal to be applied to said actuator inaccordance with predetermined logic in conformity with the state of aninput signal from said detector and the state of an auxiliary inputsignal; when there is an actuator not operating normally in saidcontrolled system, determining that the actuator to which the outputsignal is to be applied is faulty in a case where the state of theoutput signal has not become normal even upon elapse of a prescribedtime from establishment of a condition for generation of an outputsignal to be applied to the actuator; extracting an input signal thathas influenced said logical operation, which gave rise to saiddetermined abnormal output signal; and in a case where said extractedinput signal is from said detector, storing an identification code ofthis input signal in a storage device.
 65. A control method fordetecting a fault in an input signal, said control method controlling acontrolled system including one or two or more detectors and one or twoor more actuators, said control method comprising the stepsof:generating an output signal to be applied to said actuator inaccordance with predetermined logic in conformity with the state of aninput signal from said detector and the state of an auxiliary inputsignal;. when there is an actuator not operating normally in saidcontrolled system, extracting, on the basis of a designated abnormaloutput signal corresponding to the actuator not operating normally, aninput signal that has influenced said logical operation, which gave riseto this abnormal output signal; and storing an identification code ofsaid extracted input signal in a storage device.
 66. A programmablelogic controller, which is equipped with a function for detecting afault in a detector, for controlling a controlled system including oneor two or more detectors and one or two ore more actuators, saidcontroller comprising:an arithmetic-logic unit for generating an outputsignal to be applied to said actuator in accordance with predeterminedlogic in conformity with the state of an input signal from saidconformity with the state of an input signal from said detector and thestate of an auxiliary input signal; a designation input unit which, whenthere is an actuator not operating normally in said control led system,designates an identification code of an abnormal output signalcorresponding to the actuator not operating normally; an input-signalextractor for extracting an input signal that has influenced a logicaloperation, performed by said arithmetic-logic unit, which gave rise tothe abnormal output signal designated by said designation input unit;and a storage device which, if the input signal extracted by saidinput-signal extractor is from said detector, stores an identificationcode of this input signal.
 67. A computer system, which is equipped witha function for detecting a fault in a detector, for controlling acontrolled system including one or two or more detectors and one or twoor more actuators, said computer system comprising:an arithmetic-logicunit for generating an output signal to be applied to said actuator inaccordance with predetermined logic in conformity with the state of aninput signal from said detector and the state of an auxiliary inputsignal; a designation input unit which, when there is an actuator notoperating normally in said controlled system, designates anidentification code of an abnormal output signal corresponding to theactuator not operating normally; an input-signal extractor forextracting an input signal that has influenced a logical operation,performed by said arithmetic-logic unit, which gave rise to the abnormaloutput signal designated by said designation input unit; and a storagedevice which, if the input signal extracted by said input-signalextractor is from said detector, stores an identification code of thisinput signal.
 68. A programmable logic controller, which is equippedwith a function for detecting a fault in an actuator and a detector, forcontrolling a controlled system including one or two or more detectorsand one or two or more actuators, said controller comprising;anarithmetic-logic unit for generating an output signal to be applied tosaid actuator in accordance with predetermined logic in conformity withthe state of an input signal from said detector and the state of anauxiliary input signal; a determining unit which, when there is anactuator not operating normally in said controlled system, determinesthat the actuator to which the output signal is to be applied is faultyin a case where the state of the output signal has not become normaleven upon elapse of a prescribed time from establishment of a conditionfor generation of an output signal to be applied to the actuator; aninput-signal extractor for extracting an input signal that hasinfluenced a logical operation, performed by said arithmetic-logic unit,which gave rise to an abnormal output signal determined by saiddetermining unit; and a storage device which, if the input signalextracted by said input-signal extractor is from said detector, storesan identification code of this input signal.
 69. A computer system,which is equipped with a function for detecting a fault in an actuatorand a detector, for controlling a controlled system including one or twoor more detectors and one or two or more actuators, said computer systemcomprising:an arithmetic-logic unit for generating an output signal tobe applied to said actuator in accordance with predetermined logic inconformity with the state of an input signal from said detector and thestate of an auxiliary input signal; a determining unit which, when thereis an actuator not operating normally in said controlled system,determines that the actuator to which the output signal is to be appliedis faulty in a case where the state of the output signal has not becomenormal even upon elapse of a prescribed time from establishment of acondition for generation of an output signal to be applied to theactuator; an input-signal extractor for extracting an input signal thathas influenced a logical operation, performed by said arithmetic-logicunit, which gave rise to an abnormal output signal determined by saiddetermining unit; and a storage device which, if the input signalextracted by said input-signal extracting means is from said detector,stores an identification code of this input signal.
 70. A programmablelogic controller, which is equipped with a function for detecting afault in an input signal, for controlling a controlled system includingone or two or more detectors and one or two or more actuators, saidcontroller comprising:an arithmetic-logic unit for generating an outputsignal to be applied to said actuator in accordance with predeterminedlogic in conformity with the state of an input signal from said detectorand the state of an auxiliary input signal; a designation input unitwhich, when there is an actuator not operating normally in saidcontrolled system, designates an identification code of an abnormaloutput signal corresponding to the actuator not operating normally; aninput-signal extractor for extracting an input signal that hasinfluenced a logical operation, performed by said arithmetic-logic unit,which gave rise to the abnormal output signal designated by saiddesignation input unit; and a storage device for storing anidentification code of the input signal extracted by said input-signalextractor.
 71. A computer system, which is equipped with a function fordetecting a fault in an input signal, for controlling a controlledsystem including one or two or more detectors and one or two or moreactuators, said computer system comprising:an arithmetic-logic unit forgenerating an output signal to be applied to said actuator in accordancewith predetermined logic in conformity with the state of an input signalfrom said detector and the state of an auxiliary input signal; adesignation input unit which, when there is an actuator not operatingnormally in said controlled system, designates an identification code ofan abnormal output signal corresponding to the actuator not operatingnormally; an input-signal extractor for extracting an input signal thathas influenced a logical operation, performed by said arithmetic-logicunit, which gave rise to an abnormal output signal designated by saiddesignation input unit; and a storage device for storing anidentification code of the input signal extracted by said input-signalextractor.